We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 994e1cb + ec6270d commit d9425c0Copy full SHA for d9425c0
lib/index.js
@@ -50,7 +50,7 @@ module.exports = function(options) {
50
console.log('filename yo', filename);
51
}
52
53
- return req.files[fieldname] = {
+ var newFile = {
54
name: filename,
55
data: buf,
56
encoding: encoding,
@@ -67,6 +67,15 @@ module.exports = function(options) {
67
});
68
69
};
70
+
71
+ if (!req.files.hasOwnProperty(fieldname)) {
72
+ req.files[fieldname] = newFile;
73
+ } else {
74
+ if (req.files[fieldname] instanceof Array)
75
+ req.files[fieldname].push(newFile);
76
+ else
77
+ req.files[fieldname] = [req.files[fieldname], newFile];
78
+ }
79
80
81
0 commit comments