[multi-part requests] addMultipartFile() is not spec compliant (does not support multiple files for the same key)
See original GitHub issuehttps://tools.ietf.org/html/rfc7578#section-4.3
To match widely deployed implementations, multiple files MUST be sent by supplying each file in a separate part but all with the same “name” parameter
addMultiPartFile
method stores the data in a hashmap, and adding multiple files by the same key name will result in the previous file reference being overwritten.
Please add a warning for this method (or in the docs), so that user’s know about this bug. Otherwise this can go unnoticed, which will lead to data loss for the clients.
related:
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
How to send multipart/form-data request using Postman [closed]
@maxkoryukov Thank your for your comments. My API was not working at all while I was trying multipart file upload using Postman client....
Read more >Uploading and copying objects using multipart upload
Multipart upload allows you to upload a single object as a set of parts. Each part is a contiguous portion of the object's...
Read more >Form-based File Upload in HTML RFC 1867 - IETF Datatracker
The author of an HTML form who wants to request one or more files from a user would write (for example): <FORM ENCTYPE="multipart/form-data"...
Read more >Handling File Uploads With Flask - miguelgrinberg.com
form and request.files dictionaries are really "multi-dicts", a specialized dictionary implementation that supports duplicate keys. This is ...
Read more >Multipart (Form Data) Format - MuleSoft Documentation
Notice that the key determines the part's name if the name is not explicitly provided in the Content-Disposition header, and note that DataWeave...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Use this
addMultipartFile(Map<String, File> multiPartFileMap)
@indraniltalukdar Yes, you can do like you have done above. Just pass the number and fileList as you have done above.