busboy
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -96,3 +96,3 @@ // TODO: | ||
var file = new FileStream(); | ||
boy.emit('file', fieldname, file, filename, encoding); | ||
boy.emit('file', fieldname, file, filename, encoding, contype); | ||
@@ -99,0 +99,0 @@ onData = function(data) { |
{ "name": "busboy", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"author": "Brian White <mscdex@mscdex.net>", | ||
@@ -4,0 +4,0 @@ "description": "A streaming parser for HTML form data for node.js", |
@@ -84,5 +84,5 @@ | ||
console.log('Start parsing form ...'); | ||
busboy.on('file', function(fieldname, file, filename, encoding) { | ||
busboy.on('file', function(fieldname, file, filename, encoding, mimetype) { | ||
++infiles; | ||
onFile(fieldname, file, filename, encoding, function() { | ||
onFile(fieldname, file, filename, function() { | ||
++outfiles; | ||
@@ -109,3 +109,3 @@ if (done) | ||
function onFile(fieldname, file, filename, encoding, next) { | ||
function onFile(fieldname, file, filename, next) { | ||
// or save at some other location | ||
@@ -136,4 +136,4 @@ var fstream = fs.createWriteStream(path.join(os.tmpDir(), path.basename(filename))); | ||
var busboy = new Busboy({ headers: req.headers }); | ||
busboy.on('file', function(fieldname, file, filename, encoding) { | ||
console.log('File [' + fieldname +']: filename: ' + filename + ', encoding: ' + encoding); | ||
busboy.on('file', function(fieldname, file, filename, encoding, mimetype) { | ||
console.log('File [' + fieldname +']: filename: ' + filename); | ||
file.on('data', function(data) { | ||
@@ -193,3 +193,3 @@ console.log('File [' + fieldname +'] got ' + data.length + ' bytes'); | ||
* **file**(< _string_ >fieldname, < _ReadableStream_ >stream, < _string_ >filename, < _string_ >transferEncoding) - Emitted for each new file form field found. `transferEncoding` contains the 'Content-Transfer-Encoding' value for the file stream. | ||
* **file**(< _string_ >fieldname, < _ReadableStream_ >stream, < _string_ >filename, < _string_ >transferEncoding, < _string_ >mimeType) - Emitted for each new file form field found. `transferEncoding` contains the 'Content-Transfer-Encoding' value for the file stream. `mimeType` contains the 'Content-Type' value for the file stream. | ||
@@ -196,0 +196,0 @@ * **field**(< _string_ >fieldname, < _string_ >value, < _boolean_ >valueTruncated, < _boolean_ >fieldnameTruncated) - Emitted for each new non-file field found. |
649315