How to upload images on heroku server using attachment_fu plugin

风流意气都作罢 提交于 2019-12-06 01:43:31

问题


I have an app in Heroku, I need simple file storage for uploaded images for this I used send_data using attachment_fu plugin. After that I have used the tmp/ directory to write this file and want to display on browser, But these files are not displayed in browser. How can I display these images on browser?

What is the alternate solution to store and retrieve images?

Thanks!


回答1:


You cannot store uploaded files on Heroku.

You must use an alternative strategy. A couple alternative strategies:

  1. Store uploaded files in your database on Heroku. Because database systems are not specifically optimized for storing files, you should test out how well your application performs under load before you use this strategy.

  2. Store uploaded files in an external storage service. Amazon S3 is a popular cloud storage service that anyone can use, and it has pay-as-you-go pricing just like Heroku. (In fact, Heroku itself runs on top of another of Amazon's cloud services, EC2.)



来源:https://stackoverflow.com/questions/4546206/how-to-upload-images-on-heroku-server-using-attachment-fu-plugin

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