DEV Community

TANMOY MANDAL
TANMOY MANDAL

Posted on

Why photo not upload when i deploy on heroku

I made a MERN project,there for my backend i use multer for form upload. It work perfectly in my local machine and posted photo save on my nodejs directory but when i deploy it on heroku,photo not save on upload directory please help me i try to solve it from many hours

Top comments (6)

Collapse
 
olivierjm profile image
Olivier JM Maniraho

Heroku only gives you an instance to host your app but doesn't give you a file system to write to, that means you can't directly upload files, if you need to make use of the file system for uploading and reading of files you might want to use like Digital Ocean droplets or AWS EC2, the most efficient way for you with Heroku will be to use Cloudinary or AWS S3 buckets, these services are optimised for file handling and delivery too.

Collapse
 
orneliochauque profile image
Ornélio Chaúque

I had the same issue. Thanks for replay, really helped me.

Collapse
 
tantanmoy profile image
TANMOY MANDAL

Thank you...

Collapse
 
sergiodxa profile image
Sergio Daniel Xalambrí • Edited

You can’t write to disk in Heroku, you will need to use a service like AWS S3 or Cloudinary. I think Heroku must have add-ons for othe similares services to upload images.

Collapse
 
tantanmoy profile image
TANMOY MANDAL

Thank you....

Collapse
 
santhosh47 profile image
Santhosh-47

I'm using #django using #vscode. The problem is about images are not shown in #heroku while hosting a website. Can you help me........