Where does heroku store uploaded files when using paperclip

安稳与你 提交于 2019-12-07 05:19:21

问题


I have created a simple ROR application and installed paperclip with this configuration

has_attached_file :attachment,
  :path => ":rails_root/public/system/:attachment/:id/:filename",
  :url => "/system/:attachment/:id/:filename

then i created a simple form that takes the file as input from the user web browser, after that the file url is being displayed model.attachment.url and the user can download the file again.

I tried to run some linux commands to know where are downloaded files are stored 'ls /app/public/system/attachments/' but couldn't all my uploaded files.

Also some files are being uploaded but when trying to get them back i receive 404 error!

has any one experienced such problem before?


回答1:


Heroku keeps paperclip uploaded images for few minutes then automatically removes them, it only keeps images residing in assets. To keep docs or images you need amazon s3 or other web services



来源:https://stackoverflow.com/questions/20104005/where-does-heroku-store-uploaded-files-when-using-paperclip

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!