Reputation: 406
I am trying to deploy a Laravel application on Heroku. The problem is that every time I push changes to heroku, the old uploaded assets are lost. I am storing the images uploaded to a directory uploaded
which are lost everything I push changes. Is there a way to prevent it?
Upvotes: 0
Views: 116
Reputation: 3586
Heroku doesn't have a persistent file system. Your files disappear because each deploy restarts your dynos, effectively destroying all the previously uploaded files. You must use cloud storage on Heroku for anything you wish to be permanent, like avatars, uploaded documents, etc. Check out their Add-ons for examples.
https://devcenter.heroku.com/articles/dynos#ephemeral-filesystem
Upvotes: 1
Reputation: 179994
Heroku's filesystem is not persistent. You need to store uploaded files somewhere offsite. Amazon S3 is a common choice.
Upvotes: 1