-
Notifications
You must be signed in to change notification settings - Fork 38.5k
File upload with Servlet 3 multipart requests should support filename with charset encoding (RFC 2231) [SPR-13319] #17904
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
Comments
Rossen Stoyanchev commented Any idea where and how exactly it fails? Can you provide a stack trace? |
Andy Goossens commented The HTTP request body that Python was sending us:
This should result in a file called "élève.txt". Our controller method looks like:
This is the stacktrace:
What I see reading from the code:
|
Rossen Stoyanchev commented Okay I see now. Indeed it looks like |
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:
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:
Referenced from: commits 1a9e42b
The text was updated successfully, but these errors were encountered: