You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to implement a file uploader for a very-legacy system that is using a content-disposition: form-data; name="message"; fileName="sample.txt" header in multipart/form-data uploads.
The parameters "filename" and "filename*", to be matched case-insensitively, provide information on how to construct a filename for storing the message payload.
Expected output: request.files has two elements, "message" and "binary"
Actual output: request.form has two elements, "message" and "binary", request.files has none
Environment:
Python version: 3.9.10
Werkzeug version: 2.1.2
P.S: the legacy system I'm using fails to submit an epilogue, instead sending a regular boundary (I've fixed that in the above example), causing the parsing to fail with a ValueError which is however silently ignored somewhere upstack, resulting in a "successful" parsing of the form that has neither form fields nor files on it. I'm not sure if this silent ignoring of a form error should be reported as a separate bug.
The text was updated successfully, but these errors were encountered:
I was trying to implement a file uploader for a very-legacy system that is using a
content-disposition: form-data; name="message"; fileName="sample.txt"
header in multipart/form-data uploads.Flask/werkzeug/sansio is only looking for a
filename
extra, so it misses thefileName
extra.Therefore, the files are misdetected as fields instead of as files.
However, RFC6266 §4.3 says that
Minimal example:
Payload to trigger the issue:
Save the above into request.http and run to test:
Expected output: request.files has two elements, "message" and "binary"
Actual output: request.form has two elements, "message" and "binary", request.files has none
Environment:
P.S: the legacy system I'm using fails to submit an epilogue, instead sending a regular boundary (I've fixed that in the above example), causing the parsing to fail with a ValueError which is however silently ignored somewhere upstack, resulting in a "successful" parsing of the form that has neither form fields nor files on it. I'm not sure if this silent ignoring of a form error should be reported as a separate bug.
The text was updated successfully, but these errors were encountered: