Skip to content
Myr

Binary encoding for multi-part file uploads

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

authored by visionmedia · committed by visionmedia · parent 2a89f37 · Browse files · 1 file+1 added−1 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+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:lib/express/core.js+1 added-1 removed
228 unmodified lines
229 request.params = { post: {}}230 promise.timeout(set('upload timeout') || 5000)231 stream.addListener('part', function(part){232 if (part.filename) {233 var file = new File(part.tempfile = '/tmp/express-' + Number(new Date) + utils.uid(), 'w')233 var file = new File(part.tempfile = '/tmp/express-' + Number(new Date) + utils.uid(), 'w', { encoding: 'binary' })234 ++pendingFiles235 part.pos = 0236 part.addListener('body', function(chunk){237 file.write(chunk, part.pos, 'binary').addErrback(function(){
97 unmodified lines