This question has already been answered:

Hello. I uploaded a heroku site yesterday. After installing the site, uploaded a photo. After some time, the images are deleted. What could be the problem? New to ruby ​​on rails. Thanks for attention :)

Reported as a duplicate by D-side , Kromster , aleksandr barakin , Nick Volynkin 14 Oct '16 at 14:52 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

    1 answer 1

    Heroku does not provide storage space for downloadable files. You only have 300MB allocated to the slug (pre-launch project) and the / tmp folder for storing the cache and freshly downloaded files. This folder is periodically cleared, and your files uploaded to it disappear.

    You can use Amazon S3 to store downloaded files by associating it with a rail application using the fog or aws-s3 gems. Look for S3 connection instructions through these gems with your file uploader ( carrierwave , paperclip ).