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
When using pyramid backend and formdata file upload, we may have trouble with utf8 or other non-ascii encoded filename, in api depending on the client implementation of file upload
This trouble happened because in case a file is utf8 encoded, RFC6266 say we should use filename* instead of filename in content-disposition of form when encoding is not utf8. requests python library and httpie command line do only set filename* in the utf8 filename case, but not filename.
When using pyramid backend and formdata file upload, we may have trouble with utf8 or other non-ascii encoded filename, in api depending on the client implementation of file upload
This is because we need to get a cgi.fieldstorage object. As explain in this issue:
https://stackoverflow.com/questions/42213318/cgi-fieldstorage-with-multipart-form-data-tries-to-decode-binary-file-as-utf-8-i
in case there is no "filename" field decoding of file is not processed as expected and will not be correctly handled as a files by pyramid.
This trouble happened because in case a file is utf8 encoded, RFC6266 say we should use
filename*
instead offilename
in content-disposition of form when encoding is not utf8.requests
python library andhttpie
command line do only setfilename*
in the utf8 filename case, but notfilename
.There is an issue in cgi lib here about handling properly
filename*
in cgi.FieldStorage file:https://bugs.python.org/issue23434
and a PR proposal here:
python/cpython#6027
The text was updated successfully, but these errors were encountered: