开发者

Rails paperclip uploading file outside 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜