开发者

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
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜