Created
April 10, 2011 09:55
-
-
Save tommedema/912200 to your computer and use it in GitHub Desktop.
This file contains 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
module.exports = function(server, everyone) { | |
var util = require('util'); | |
var formidable = require('formidable'); | |
server.post('/upload', function(req, res) { | |
util.log('/upload request, content type: ' + req.headers['content-type']); | |
//headers look like eg. 'multipart/form-data; boundary=----pluploadboundaryp15svdal5r1c4ni4610kk1tssa8d4' | |
var form = new formidable.IncomingForm(); | |
form.keepExtensions = true; | |
form.onPart = function(part) { | |
util.debug('getting part...'); | |
part.addListener('data', function() { | |
util.debug('part data...'); | |
}); | |
}; | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment