Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CommonsMultipartFile.getOriginalFilename() should be able to preserve header-specified filename as-is [SPR-14613] #19180

Closed
spring-projects-issues opened this issue Aug 22, 2016 · 1 comment
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Aug 22, 2016

Juergen Hoeller opened SPR-14613 and commented

getOriginalFilename() explicitly strips path information from a Commons-FileUpload-given filename in CommonsMultipartFile but just exposes the header-specified filename as-is in StandardMultipartFile.

Let's revisit what's actually necessary in 2016 and whether the behavior needs to be more consistent here.


Issue Links:

Referenced from: commits 5115c61, aa29495

1 votes, 2 watchers

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

I've added a corresponding preserveFilename flag to CommonsMultipartResolver (or more specifically a setPreserveFilename(boolean) method to its superclass CommonsFileUploadSupport, passed on to CommonsMultipartFile: Switching that flag to true forces getOriginalFilename() to return the FileItem.getName() result as-is, not artificially stripping off any path information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants