-
-
Notifications
You must be signed in to change notification settings - Fork 16.3k
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
flask doesn't return http error 413 if file too large #3874
Comments
Try to use a production server like Gunicorn, as explained in the docs for uploading:
By the way, what's the environment of your own PC (that works as expected)? |
I'm going to close this, feel free to comment further. |
@greyli
I run it Powershell, Windows 10. Gunicorn is a Unix webserver, uWSGI needs linux subsystem, event works but it seems you need to provide Flask says it does not scale well and not suggested, it doesn't say it doesn't work properly, that's a large difference. It would be better to mention to not expect to work properly, many of us think it works according to the specs, but with low performance. And why does it work on my home pc and not on my work pc? I am happy to give further details if sb wants to investigate it. |
Waitress works on Windows.
Please provide more details at pallets/werkzeug#1513, I think this will be fixed further in Werkzueg (check the discussion in that issue). Thank you! |
Addressed by pallets/werkzeug#2620, the development server will exhaust input in most cases and let the 413 through, although the previous comments here still stand. It's up to the client how they handle the connection being closed before all input is sent. |
situation overview
I set up a file upload application and in case the user gives a too large file, I want to send a message that the file is too large. On my own PC, everything works fine, but in my corporate environment, flask doesn't return the message I want.
Example code
Expected Behavior
I expect flask to return "I could send a template with the result." or without werkzeug, to
return str(error) + " I could have sent an HTML template too.", 413
But none of them happens.Actual Behavior
My browser gets an ERR_CONNECTION_ABORTED message.
This is what I get on the terminal:
Environment
The text was updated successfully, but these errors were encountered: