diff --git a/lib/incoming_form.js b/lib/incoming_form.js index 62c9e3bc..584e0389 100644 --- a/lib/incoming_form.js +++ b/lib/incoming_form.js @@ -278,7 +278,8 @@ IncomingForm.prototype._initMultipart = function(boundary) { part.name = m[1]; } - if (m = headerValue.match(/filename="([^;]+)"/i)) { + if (m = headerValue.match(/filename="([^"\\]*(?:\\.[^"\\]*)*)"/i)) { + m[1] = m[1].replace(/\\"/ig, '"'); part.filename = m[1].substr(m[1].lastIndexOf('\\') + 1); } } else if (headerField == 'content-type') {