The most used, flexible, fast and streaming parser for multipart form data. Supports uploading to serverless environments, AWS S3, Azure, GCP or the filesystem. Used in production.
MIT License
7k
stars
680
forks
source link
Attach fields to req.body and files to req.files like multer #952
which support plan is this issue covered by? Community
_is this issue currently blocking your project? yes
Context
Allow access to fields and files by attaching them to req body.
What problem are you trying to solve?
So fields and fields are accessible in middlewares
app.post('/upload-formidable', (req, res, next) => {
const form = formidable({});
// this is fine
form.parse(req, (err, fields, files) => {
res.json({ fields, files });
});
// but should also be able to do this
req.body // should be fields object
req.files // should be files object
});
Do you have a new or modified API suggestion to solve the problem?
Support plan
Community
Context
Allow access to fields and files by attaching them to req body.
What problem are you trying to solve?
So fields and fields are accessible in middlewares
Do you have a new or modified API suggestion to solve the problem?
No