-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Closed
Closed
Copy link
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancementA general enhancement
Milestone
Description
Paul opened SPR-15538 and commented
Some browsers (i.e. Chrome and Safari) can send multipart uploads with non-ascii symbols in filename like
Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryNyoLBPoS0jG219lU
…omitted…
------WebKitFormBoundaryNyoLBPoS0jG219lU
Content-Disposition: form-data; name="file"; filename="фывафыва.pdf"
Content-Type: application/pdf
------WebKitFormBoundaryNyoLBPoS0jG219lU--
as you can see filename is UTF-8 string. And MultipartFile handles this correctly!
I need to emulate such behaviour with RestTemplate. Best solution I've found is to use custom FormHttpMessageConverter, but it encodes filename into base64. If I override getFilename() method, removing file encoding to base64 then question marks go to server instead of non-ascii symbols.
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
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancementA general enhancement