File still uploads even when it exceeds fileSize limit
See original GitHub issueFor testing purposes, I’m uploading a 102kB file with limits setup like so:
...
const limits = {
fileSize: 5,
};
const upload = multer({storage: storage, fileFilter: fileFilter, limits: limits});
...
Clearly that exceeds the 5 byte limit, but I’m finding that the file still gets saved without any errors, except that the saved file is 5 bytes in size, so it seems something just writes the first part of the file and then gives up. I’m assuming this isn’t an intended feature, but do correct me if I’m wrong.
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
How to Fix the uploaded file exceeds ...
In order to fix this error, you need to increase the file size upload limit. That is, you need to increase the value...
Read more >How to Fix the File Size Exceeds Limit Error 0x800700DF ...
2. Use the Registry Editor ... If you get the File exceeds the limit allowed and cannot be saved error when you transfer...
Read more >How To Fix Uploaded File Exceeds Max Size Error
Trying to upload a big file into WordPress and getting a message telling you the file is too big, exceeds the maximum upload...
Read more >How to Fix This Error: The Uploaded File Exceeds ...
The error occurs when you are trying to upload a large file which can be an image, plugin, theme, or video. If the...
Read more >Attachment size exceeds the allowable limit error - Outlook
This limit prevents your computer from continually trying to upload very large attachments that exceed the limits of most Internet service ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
line changed: form.append(‘file’, util.file(‘huge.rar’)) //huge.rar is a file of 2600M (2.6G)
mocha --timeout 120000 issue-232.js
Issue #232 √ should report limit errors (24565ms)
1 passing (25s) //<------ too long
When I test in Chrome locally, I get 0% to 100% uploading status report from Chrome, and at 100%, get a “MulterError: File too large”. The error emit after all the file has uploaded.
windows 7, node v6.5, multer 1.4.1
Hi @FINDarkside, You’re welcome 😃. Last I tested which was a couple months ago with Firefox, it timed out when Formidable closed the connection on a large file upload. So yup it looks like browsers are still not following the spec. Here’s some Formidable middleware for Express that works well for me. It’s better than using express-formidable because you get more control by implementing it yourself: