node-formidable / formidable

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
7.04k stars 683 forks source link

Is incomingForm config 'multiples' necessary? #485

Closed zhoupengqiang closed 3 years ago

zhoupengqiang commented 5 years ago

I think multiples=true is the correct behavior and multiples = false incorrect when I upload multiple files in an input tag because of incorrect info in parsed files object.

I don't think user have to set multiples. The parsed files object should always give right info, either depending on user upload or always use an array for a named input.

xarguments commented 5 years ago

Yes, it is necessary and it makes sense to turn it on by default.

If you are curious why it wasn't set to "true" by default - read this discussion. If we turned it on while implementing it, the library would have become backward incompatible. So it was implemented as an "option" so that older applications depending on Formidable didn't break.

Anyway, it may be set to "true" in the next major version. I will mark this as "feature" request, so that we could get back to it when implementing the next major version.

GrosSacASac commented 4 years ago

Should we do it now ?

VictorJozwicki commented 3 years ago

canary doesn't seem to have this behaviour (yet ?)

tunnckoCore commented 3 years ago

@VictorJozwicki what you mean?

VictorJozwicki commented 3 years ago

I thought this thread would imply that at some point multiples: true would be the default behaviour ?

tunnckoCore commented 3 years ago

@VictorJozwicki yes, not yet. It's easy option and there're bigger problems, haha.

GrosSacASac commented 3 years ago

npm i node-formidable/formidable#3.x