Skip to content

fix: do not reject files whose size equals limits.fileSize#1402

Open
SAY-5 wants to merge 1 commit into
expressjs:mainfrom
SAY-5:fix/file-size-limit-off-by-one
Open

fix: do not reject files whose size equals limits.fileSize#1402
SAY-5 wants to merge 1 commit into
expressjs:mainfrom
SAY-5:fix/file-size-limit-off-by-one

Conversation

@SAY-5

@SAY-5 SAY-5 commented May 12, 2026

Copy link
Copy Markdown

Busboy emits its limit event once a file reaches exactly fileSize bytes, so multer rejects uploads that are exactly at the limit with LIMIT_FILE_SIZE. This passes fileSize + 1 down to Busboy so the limit only triggers when the size is genuinely exceeded. Closes #1348.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

multer throws "File too large" error if file size of exact "limits.fileSize" bytes provided.

1 participant