Skip to content

MultipartHttpServletRequest cannot handle multiple file inputs with same name-attribute [SPR-3964] #8644

Closed
@spring-projects-issues

Description

@spring-projects-issues

Eirik Lygre opened SPR-3964 and commented

MultipartHttpServletRequest tracks and exploses uploaded files in a java.util.Map (through setMultipartFiles() and getFileMap()), with the key of the map being the name-attribute from the html-form. This means that files uploaded from the html-code will only ever show a single file, even though the user may have selected more than one:

...
<input type="file" name="attachment" />
<input type="file" name="attachment" />
<input type="file" name="attachment" />
...

I haven't found anything in the relevant standard (rfc1867 et al) that prohibits this, and indeed the underlying Jakarta Commons FileUpload infrastructure supports this through it's use of a List rather than a Map.


No further details from SPR-3964

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions