Skip to content
Myr

Styling

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by visionmedia · committed by visionmedia · parent c8d3bfa · Browse files · 1 file+13 added−15 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+13 added−15 removed

  • other:+13 added−15 removed

1 file+13 added−15 removed

modified:lib/express/core.js+13 added-15 removed
224 unmodified lines
225 var stream = multipart.parse(request)226 request.params = { post: {}}227 stream228 .addListener('partBegin', function(part) { 229 if (part.filename) {230 part.tempfile = '/tmp/express-' + Number(new Date) + utils.uid()231 part.fileStream = fs.createWriteStream( part.tempfile )232 }233 else part.buf = ''229 if (part.filename)230 part.tempfile = '/tmp/express-' + Number(new Date) + utils.uid(),231 part.fileStream = fs.createWriteStream(part.tempfile)232 else233 part.buf = ''234 })235 .addListener('partEnd', function(part) { 236 if (part.name) { // Not sure why this guard is needed, but otherwise we get an undefined part.name being passed?237 if (part.fileStream) { 238 part.fileStream.close()239 utils.mergeParam(part.name, { filename: part.filename, tempfile: part.tempfile }, request.params.post) 240 }241 else242 utils.mergeParam(part.name, part.buf, request.params.post) 243 }244 })235 .addListener('body', function(chunk) {236 if (stream.part.fileStream)237 stream.part.fileStream.write(chunk)238 else239 part.buf += chunk240 })241 .addListener('partEnd', function(part) {242 if (!part.name) return243 if (part.fileStream)244 part.fileStream.close(),245 utils.mergeParam(part.name, { filename: part.filename, tempfile: part.tempfile }, request.params.post) 246 else247 utils.mergeParam(part.name, part.buf, request.params.post) 248 })249 .addListener('error', callback)250 .addListener('complete', callback)251 }252 else
70 unmodified lines