开发者

Can carrierwave gem store file on AWS-S3 and local file system at the same time?

开发者 https://www.devze.com 2023-03-13 18:02 出处:网络
I use carrierwave as my upload gem in rails 3.0.7, and it\'s really awesome. I can upload files to local file system(storage :file), 开发者_JAVA百科and I know how to upload to AWS-S3 as well(storage

I use carrierwave as my upload gem in rails 3.0.7, and it's really awesome.

I can upload files to local file system(storage :file), 开发者_JAVA百科and I know how to upload to AWS-S3 as well(storage :fog), but is there any way to upload files to those two destinations at the same form submit? Just in case if local file system or S3 crash or file missing, I still have another copy.


You can try this:

http://carrierwave.rubyforge.org/rdoc/classes/CarrierWave/Storage/S3.html


    CarrierWave.configure do |config|
      config.s3_access_key_id = "xxxxxx"
      config.s3_secret_access_key = "xxxxxx"
      config.s3_bucket = "my_bucket_name"
    end
0

精彩评论

暂无评论...
验证码 换一张
取 消