Filename path is stripped for CommonsMultipartFile but not for StandardMultipartFile #26207
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: declined
A suggestion or change that we don't feel we should currently apply
Affects: 5.3.1
MultipartFile#getOriginalFilename
says in the Javadoc:But for CommonsMultipartFile (one of the two provided implementations of the
MultiPartFile
interface) there is actually a config optionsetPreserveFilename()
which controls whether the path will be stripped away or not.StandardMultipartFile
doesn't do that and doesn't have the config option. But actually the path stripping is done by Spring code, not Apache Commons code, see https://github.com/spring-projects/spring-framework/blob/master/spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsMultipartFile.java#L102I would suggest to use the path stripping code also for
StandardMultipartFile
, or would there be any reason not to?The text was updated successfully, but these errors were encountered: