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
which ultimately comes to AbstractMutlipartHttpServletRequest:
public Map<String, MultipartFile> getFileMap() {
return getMultipartFiles().toSingleValueMap();
}
Here it loses all but the first files.
Possible solution: Use MultipartHttpInputMessage#getMultiFileMap instead of getFileMap. I suggest to treat this as a bug because it really seems that getFileMap was used inadvertently.
Workaround: use different names for all multipart files (pretty ugly, though).
The text was updated successfully, but these errors were encountered:
Fixesspring-projects#2872
The same HTML form entry may have several files in the multi-part request.
Parse all of them in the `MultipartAwareFormHttpMessageConverter.java`
and re-map to the result `MultiValueMap`
**Cherry-pick to 5.1.x**
* GH-2872: Parse all the multi-part files
Fixes#2872
The same HTML form entry may have several files in the multi-part request.
Parse all of them in the `MultipartAwareFormHttpMessageConverter.java`
and re-map to the result `MultiValueMap`
**Cherry-pick to 5.1.x**
* * Add test for multi-part files
* GH-2872: Parse all the multi-part files
Fixes#2872
The same HTML form entry may have several files in the multi-part request.
Parse all of them in the `MultipartAwareFormHttpMessageConverter.java`
and re-map to the result `MultiValueMap`
**Cherry-pick to 5.1.x**
* * Add test for multi-part files
Affects Version(s): 5.1.3
Bug
The multipart/form-data RFC states:
However, when I send a multipart message with three parts named
data
, only one makes it into the message.Sample request (with Intellij's http client)
The reason is that
MultipartAwareFormHttpMessageConverter#readMultipart
usesmultipartRequest.getFileMap()
to access the files:which ultimately comes to
AbstractMutlipartHttpServletRequest
:Here it loses all but the first files.
Possible solution: Use
MultipartHttpInputMessage#getMultiFileMap
instead ofgetFileMap
. I suggest to treat this as a bug because it really seems thatgetFileMap
was used inadvertently.Workaround: use different names for all multipart files (pretty ugly, though).
The text was updated successfully, but these errors were encountered: