-
Notifications
You must be signed in to change notification settings - Fork 130
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 size - multipart/form-data #140
Comments
Looks like it's only for urlencoded forms. Perhaps something for 5.0.0 (ding #139) where we hook up formLimit up to formidible's Would def be a BC breaker though. |
A few other notes about your sample code:
I would change the options in your code to: app.use(koaBody({
multipart: true,
json: true,
formLimit: MAX_BODY,
textLimit: MAX_BODY,
formidable: {
maxFileSize: MAX_BODY
}
})); |
@damianb ha! you beat me by seconds 😆 |
Hah. Anyways, I do think we ought to directly expose our own upload limit property (proxied to formidible's |
Problem/Feature Request Summary
Limit file size using multipart/form-data
Related issue:
#66
#23
Environment Information
Current Behavior
Allow send file bigger than
formLimit
option.Is this a bug ? If i can send a body bigger than defined value. Is this propertie affect the body only in certain conditions ?
Steps to Reproduce
send a txt file bigger than 1k, using multipart/form-data, pass the file through
file
fieldExpected Behavior
Throw an error
Context (Environment)
I want to send a file to server.
The text was updated successfully, but these errors were encountered: