Created
November 5, 2012 21:16
-
-
Save NeCkEr/4020385 to your computer and use it in GitHub Desktop.
formidable stream
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var streamUpload = function(req, res) { | |
var stream = StreamDeDestino | |
form = new formidable.IncomingForm; | |
form.onPart = function(part) { | |
console.log("asd"); | |
if (!part.filename) { | |
return form.handlePart(part); | |
} | |
part.on('data', function(data) { | |
return stream.write(data); | |
}); | |
part.on('end', function() { | |
return stream.end(); | |
}); | |
return part.on('error', function(err) { | |
return console.log(err); | |
}); | |
}; | |
form.parse(req); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment