Heroku and multer

前端 未结 1 708
情话喂你
情话喂你 2021-01-14 07:04

I made a webapp that lets you upload a file to the server using multer. It works like it should when the server is run locally, but when I deployed it on Heroku, it seems I

相关标签:
1条回答
  • 2021-01-14 07:27

    I'm not sure why your uploads aren't being saved; you should be able to save them temporarily.

    But this won't work long-term. Heroku's filesystem is ephemeral: any changes you make will be lost the next time your dyno restarts, which happens frequently (at least once per day).

    Heroku recommends storing uploads on something like Amazon S3. Here's a guide for doing it specifically with Node.js.

    Once you've stored your files on S3 you should be able to retrieve them using an appropriate library or possibly over HTTP, depending on how you've configured your bucket.

    If you still wish to use multer, check out multer-s3.

    0 讨论(0)
提交回复
热议问题