Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Multer without express

I am trying to set up image upload for a website with a node.js backend. I am sending the image file as a FormData object on a ajax post request. Can I use Multer without Express to upload the images? If so, how can I do it? (considering that I am not using express I have to manually collect post data)

like image 708
angz Avatar asked Dec 09 '25 05:12

angz


1 Answers

Do not use multer, use busboy instead. multer is only a wrapper around busboy to stick into express' middleware system. Multer is however not strcitly required to be used with express, it just is about to fit into express.

So you could use multer by writing some "unwrapping" code. But it is easier to use busboy without unwrapping the wrapping.

There are straightforward examples on the busboy npm page.

like image 160
geer Avatar answered Dec 11 '25 00:12

geer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!