diff --git a/lib/uploadhandler.js b/lib/uploadhandler.js index 8403595..fc4c4d7 100644 --- a/lib/uploadhandler.js +++ b/lib/uploadhandler.js @@ -68,6 +68,7 @@ module.exports = function (options) { if (!--counter) { async.each(files, _.bind(function(fileInfo, cb) { this.initUrls(fileInfo, _.bind(function(err) { + fileInfo.formData = self.req.body; this.emit('end', fileInfo); cb(err); }, this)); @@ -91,6 +92,8 @@ module.exports = function (options) { self.emit('begin', fileInfo); }) .on('field', function (name, value) { + if(!self.req.body) self.req.body = {}; + self.req.body[name] = value; if (name === 'redirect') { redirect = value; }