Description
Andy Goossens opened SPR-13319 and commented
We have a Django/Python application that tries to upload a file to a Spring web application. This fails for non-latin file names as Spring Framework does not support the Content-Disposition header it is receiving. It looks something like this:
Content-Disposition: form-data; name="file"; filename*=UTF-8''foo-%c3%a4-%e2%82%ac.html
This should result in a file called foo-ä-€.html.
I cannot blame the Python app as it is following RFC 2231. The method StandardMultipartHttpServletRequest.extractFilename(String contentDisposition) has a TODO comment that seems to refer to its incapability to handle such cases:
// TODO: can only handle the typical case at the moment
This site has a nice overview of possible Content-Disposition values and how browsers cope with them: http://greenbytes.de/tech/tc2231/ But note that this page describes download actions and not uploads.
Affects: 4.1.7
Issue Links:
- StandardMultipartHttpServletRequest cannot decode multipart Content-Disposition header encoded by FormHttpMessageConverter [SPR-15205] #19769 StandardMultipartHttpServletRequest cannot decode multipart Content-Disposition header encoded by FormHttpMessageConverter
Referenced from: commits 1a9e42b