Heroku File Upload Problem

Heroku application file upload - file is deleted after some time?

Heroku file system is ephemeral so files are temporary and removed at every Dyno restart. It is likely that you have redeployed your application causing the restart of the Dyno.

Heroku also restarts a Dyno at least every 24 hours. See Heroku documentation

The good practise is to persist the files into an external storage (S3 for example). If you are interested in finding out which free options are available you can check this Git repo HerokuFiles

Error user uploading file on Heroku but not local

Turns out that uploading pics <2MB worked. Maybe it's a setting in php.ini but not sure how to edit that on Heroku

Error while uploading image on Heroku Node.js app

These errors are typically caused by the target directory (in your case, /app/public/productimages/) not yet existing.

You can use a package like mkdirp to create the directory when your app starts, or you could create the directory locally and create an empty placeholder file (named .placeholder, for instance) that you commit to your Git repository (because Git only deals with files, not directories, you can't add a completely empty directory to a repository).



Related Topics



Leave a reply



Submit