From 2b5b95557351e51cdf0f744546d8653de645d852 Mon Sep 17 00:00:00 2001 From: geemo <153330685@qq.com> Date: Fri, 8 Apr 2016 23:20:58 +0800 Subject: [PATCH] update incoming_form.js while form upload file, if not select file, still create an empty temporary file! --- lib/incoming_form.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/incoming_form.js b/lib/incoming_form.js index 0e00c703..76cc0cae 100644 --- a/lib/incoming_form.js +++ b/lib/incoming_form.js @@ -197,8 +197,11 @@ IncomingForm.prototype.onPart = function(part) { IncomingForm.prototype.handlePart = function(part) { var self = this; - - // This MUST check exactly for undefined. You can not change it to !part.filename. + + if (part.filename === ''){ + return; + } + if (part.filename === undefined) { var value = '' , decoder = new StringDecoder(this.encoding);