-
-
Notifications
You must be signed in to change notification settings - Fork 683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to limit file maxsize and form parse error not handle #324
Comments
maxFieldsSize relates to only
try checking |
It would be better to check the file size during receiving the file instead of after the file is uploaded, so I consider |
you can:
|
yes,i'm agree with @luin, Nginx upload model and S3 all have this function. |
I believe the browser has to tell the server the size in advanced... and that should be the size. But as for wanting new features the developer/owner of this has kinda abandoned/doesn't have enough time anymore to work on this. Therefore if you want the feature you'll have to implement it yourself. I have just been trying to help out with issues as much as I can because I did like the library until I needed better support myself so I switched to multer and body-parser combo (as multer only does multi-part and body-parser only does basic form data) |
Use the |
thank you @OrangeDog for confirming and the addition. |
Thank all. I have test, 'fileBegin' get the file.size is 0, and 'progress' like to solve the problem, but progress is reference whole form body, i only care about file receivedBytes. So, must implement by myself. |
rewrite the onPart function |
+1 very much needed for koa-body |
+1, using koa-body now. |
For some time there has been a good pull request that adds max upload size for files; it only needs to be merged: #357. |
AFAIU maxFileSize solves the problem, and the issue can be closed now. |
Hi, this a code in my project:
form.uploadDir = conf.getConf().storageRoot;
form.keepExtensions = true;
form.maxFieldsSize = 1 * 1024;
form.encoding = 'utf-8';
1, The property maxFieldsSize is single file max data size? if is, it's not work.
2, If set uploadDir value is unexist directory, progress can't trigger form.on('error',Fun), will
throw a err and i not catch it. So try catch not work also.
The text was updated successfully, but these errors were encountered: