You can clone with
When uploading multiple files:
<input type="file" name="someFiles" multiple="">
The request payload will contain the files in a given order:
Content-Disposition: form-data; name="someFiles"; filename="file1.jpg"
Content-Disposition: form-data; name="someFiles"; filename="file2.jpeg"
Content-Disposition: form-data; name="someFiles"; filename="file3.jpeg"
When handling the request, the order of req.files.someField does not match the order of the request payload.
This may be a connect or node-formidable bug, but I am filing against express as I have not done isolated testing.
Background: The goal is to associate an uploaded file with a user-provided label. The labels are provided via a series of text fields with named someFileLabels that are added to the form when the someFiles input changes.
The request that is sent to the server contains the files and the labels in the same order.
However, when the request is handled on the server, the indicies of req.files.someFiles do not match those of req.body.someFileLabels (which matches the order sent), so it is impossible to associate the label with the file.
It is possible for filename and size to be identical, so it's not easy to hack around this by naming the label fields according to the filename.
express uses multipart as of 3.4. what you can do is submit a pull request for a test of this.
hmm interesting yeah I've never noticed this actually, but if it's still a problem in 3.4 let us know
closing, especially since we use a different multipart parser now. please reopen with a test case if it's still an issue.