diff --git a/lib/uploadhandler.js b/lib/uploadhandler.js index ece4b55..6099e58 100644 --- a/lib/uploadhandler.js +++ b/lib/uploadhandler.js @@ -62,6 +62,7 @@ module.exports = function (options) { if (!--counter) { _.each(files, function (fileInfo) { this.initUrls(fileInfo); + fileInfo = _.extend(fileInfo, self.req.fields); this.emit('end', fileInfo); }, this); this.callback({files: files}, redirect); @@ -84,6 +85,9 @@ module.exports = function (options) { if (name === 'redirect') { redirect = value; } + if ( !self.req.fields ) + self.req.fields = {}; + self.req.fields[name] = value; }) .on('file', function (name, file) { var fileInfo = map[path.basename(file.path)];