Closed fidalgo closed 4 years ago
S3 doesn't have directories, only paths. This is something that's provided by carrierwave itself. You'll need to use a standard prefix for all of your uploaders by changing the "storage directory": https://github.com/carrierwaveuploader/carrierwave#changing-the-storage-directory
@sorentwo right, but this way I need to change store_dir
and cache_dir
for all the uploaders. It would be nice to have a way to specify a common path, that will come before those.
Some cases I think this is useful:
You can accomplish that with modules/includes within your application, at least that's how I've handled common prefixes in the past. Otherwise I suggest using separate buckets for each environment. It doesn't cost any more to have multiple buckets and you get easy environment based settings.
I would like to have my bucket organised by the two environments:
But in the configuration, I can only set the S3 bucket, not a directory. I could change in the uploaders itself but would be nice to have central place where I can configure this.
There's something I've missed from the docs?