You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chris Blunt edited this page May 9, 2016
·
6 revisions
When using Cloud Files Containers, you cannot set individual file permissions - a container and its files are either public (delivered over CDN), or private.
When using Fog in your Uploader, you can specify a different container from the configured defaults by simply calling fog_host and fog_directory directly in your uploader.
For example, given a simple web store selling documents, the uploaded document files that people can buy should be private:
# app/uploaders/document_uploader.rbclassDocumentUploader < CarrierWave::Uploader::Base# Uploader will use the private container configured in config/initializer/carrier_wave.rbstorage:fogend
Whilst the uploaded screenshots to be used on the product pages should be publicly available and delivered via CDN:
# app/uploaders/screenshot_uploader.rbclassScreenshotUploader < CarrierWave::Uploader::Basestorage:fog# Configure uploads to be stored in a public Cloud Files containerdeffog_directory'my_public_container'end# Configure uploads to be delivered over Rackspace CDNdefasset_host"c000000.cdn.rackspacecloud.com"end# Configure fog to serve using public URLdeffog_publictrueendend