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 ae32f43 + 10e90ff commit ec8087eCopy full SHA for ec8087e
lib/index.js
@@ -32,6 +32,14 @@ module.exports = function(options) {
32
file.on('end', function() {
33
if (!req.files)
34
req.files = {};
35
+
36
37
+ // see: https://github.com/richardgirges/express-fileupload/issues/14
38
+ // firefox uploads empty file in case of cache miss when f5ing page.
39
+ // resulting in unexpected behavior. if there is no file data, the file is invalid.
40
41
+ if(!buf.length)
42
+ return;
43
44
return req.files[fieldname] = {
45
name: filename,
@@ -50,6 +58,8 @@ module.exports = function(options) {
50
58
});
51
59
}
52
60
};
61
62
53
63
54
64
55
65
0 commit comments