-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<input ... multiple> doesn't work #17
Comments
This is a possible patch: flplv@2dcbb13?diff=split The problem is that it will change the I believe the correct solution is to store files in |
@flplv it can be done without breaking bc: if(req.files.hasOwnProperty(fieldName) && req.files[fieldName] instanceof Array == false){
var tmp = req.files[fieldName];//temporarily move first file into var
req.files[fieldName] = [tmp]; //reassign to array containing first file
}
else if(req.files.hasOwnProperty(fieldName) && req.files[fieldName] instanceof Array){
req.files[fieldName].push( newFileHere ); //push new file into array
} else {
//treat as single file, as we do now
} I hope this makes sense. i'm in the bed lol |
Thanks.. gonna test it and create a PR. |
I believe #18 fixes this. Updated and published to NPM registry. |
In case you have a multiple file selection input, such as
it won't work. Multiple files will be uploaded, but they will not appear in the
files
tree since this line(index.js line 53)
will be called one time per file, replacing the last file from the object.
I'll submit a patch in this Issue soon.
The text was updated successfully, but these errors were encountered: