Multiple storage types with paperclip gem
Is it possible to have multiple storage types with the Paperclip gem?
I need to be able to POST a file that a user has uploaded. Currently I am using :s3 storage option. This seems like there is extra bandwidth up and down that could b开发者_开发问答e avoided if I put the file in :rails_root/tmp
.
You can use the gem 'paperclip-storage-tmp'
his gem allows you to configure Paperclip 2.x to use your temporary directory to store the attachments.
once you have it on your project this you can do something like
class User < ActiveRecord::Base
has_attached_file :avatar, storage: :tmp
end
精彩评论