angz
angz

Reputation: 129

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)

Upvotes: 3

Views: 2054

Answers (1)

geer
geer

Reputation: 305

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.

Upvotes: 1

Related Questions