0

I am trying to move to express 4.+ and I am having trouble figuring out what I should do about file uploads.

Migration docs says I need to come up w/ an alternative but they don't really give an example. They also dropped support for a reason, which file upload package should I use?

Also read that you should not attach a form upload to every post by using:

app.use(multer(...));

Is there a good way to attach these to just a particular route?

2 Answers 2

1

formidable or busboy are options.

Expressjs 4.+ has lost this feature because it's not built on top of connect anymore.

Sign up to request clarification or add additional context in comments.

Comments

0

I use connect-busboy. I could not get 'busboy' to work. Other packages I came across but have never played with are 'flow' and 'parted'. There is also a npm package 'mongoose-file' which seems to let you add a file upload path to a mongoose Schema for upload to server. It may be handy if you are uploading other data to a MongoDB?

Basic connect-busboy and Formidable example using Express V4.2: Node/Express file upload

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.