Uploaded images go missing in heroku

No doubt heroku is the greatest thing since sliced bread, with easy deployment and stuff, and it is free to start with. Perfect for stingy developer like me. So I am working on a rails apps, deployed to heroku, with paperclip for image upload. Things work fine, except images I uploaded keep on missing. I thought heroku wouldn’t store image for free user, ha.

A quick search around internet, sure enough it is stackoverflow come with an answer top in the list. It turn out that only images in the commit and pushed to heroku are kept, example logo or icon used in the apps. Uploaded images will be removed with each push to heroku, clearly images uploaded via paperclip fall into the latter category.

Solution is to use a 3rd party storage, like Amazon Simple Storage Service. Of course, aws is free to start with as well, a free account includes 5Gb storage, 20k Get requests, 2k put request, yada yada, another great thing for stingy developer, hurray!

9 thoughts on “Uploaded images go missing in heroku

  1. Thank you for a great tip!! Could you write a small tutorial for Heroku / Images uploading to AWS set up /process? Thank you!!

  2. Hi Shreya, in your case do you mean you have images stored in heroku or a third party storage service?
    If it is the former, then even if there is no further push to heroku, images might be lost as well, as what I found out in stackoverflow, due to dyno restart that happen occasionally.

  3. Sorry, this reply is two years late ;-), and I haven’t used heroku for a while now. Guess you have find something useful for heroku/images uploading to AWS setup/process on the net?

Leave a Reply

Your email address will not be published. Required fields are marked *