Skip to content
Myr

Merge branch 'upload-limit'

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

authored by visionmedia · committed by visionmedia · parents 9a0011b, 14acbcb · Browse files · 2 files+6 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

2 files+6 added−1 removed

  • other:+6 added−1 removed

2 files+6 added−1 removed

modified:examples/upload/app.js+1 added
modified:lib/express/core.js+5 added-1 removed
227 unmodified lines
228 }229 if (request.headers['content-type'] &&230 request.headers['content-type'].includes('multipart/form-data')) {231 var stream = multipart.parse(request),232 contentLength = parseInt(request.headers['content-length']),233 maxBodyLength = set('max upload size'),234 pendingFiles = 0235 if (maxBodyLength && contentLength > maxBodyLength)236 return callback(new Error('upload size limit exceeded'))237 request.params = { post: {}}238 stream235 .addListener('partBegin', function(part) { 239 .addListener('partBegin', function(part) {240 if (part.filename)241 ++pendingFiles,242 part.tempfile = '/tmp/express-' + Number(new Date) + utils.uid(),243 part.fileStream = fs.createWriteStream(part.tempfile),
94 unmodified lines