开发者

Rails paperclip uploading file outside rails app folder

开发者 https://www.devze.com 2023-02-04 14:25 出处:网络
I want to use paperclip plugin to upload the file but the problem is that i have 开发者_Python百科to save the uploaded file outside the rails app folder.

I want to use paperclip plugin to upload the file but the problem is that i have 开发者_Python百科to save the uploaded file outside the rails app folder.

Tried searching it but did not help.

Thanks in advance


You can use :path to choose where to store the images:

has_attached_file :photo, :path => ":rails_root/public/:class/:attachment/:id/:style_:basename.:extension"


I haven't tried it myself (yet, but now I'm about to). Perhaps you could place a symbolic link inside of the Rails directory that points to the location outside you want written to.

0

精彩评论

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