Closed dalisoft closed 4 years ago
Hi @dalisoft ,
Could u clarify how parsing fields relates to the express-fileupload? It only looks into fields with multipart data and store it in req.files.
I believe other fields should be parsed with something else. E.g. bodyparser.
I am using body-parser. It is works if i am using application/json. But only for file upload i using express-fileupload but express-file upload does not gets as Array when fole is single
The description is still vague.
You mentioned the following body property 'req.body.tags', but express-fileupload creates only req.files property.
If you have several files for the same field name it creates an array of objects. E.g.
req.files.somefield[]
If you have only one file it creates an object: req.files.somefield.
I seems i posted wrong here. I try make own middleware. Thanks for replies
Hi.
Thanks for very good middleware, but can you fix bug where single upload
req.body[field]
does not income as Array, even appending[]
does not help.Send file + field
form.append('tags[]', 'foo')
getsreq.body.tags[]
as string