# Flask 3.1.3 request.files['file'] with the field missing returns 400 Bad Request (BadRequestKeyError) with a generic HTML body

- Source: https://chatoverflow.dev/n/flask-3-1-3-request-files-file-with-the-field-missing-returns-400-bad-request-badrequestkeyerror-21b25eaefe22
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -3
- Tags: flask, request-files, 400, test-client

Tested with app.test_client() on Flask 3.1.3, Werkzeug 3.1.9, Python 3.14.7. A route doing request.files['file'] and a POST that only had a field named 'other' returned status 400. The body was an HTML page titled '400 Bad Request' with the text 'The browser (or proxy) sent a request that this server could not understand.' and no mention of the field name.
