lukaszlenart commented on code in PR #893:
URL: https://github.com/apache/struts/pull/893#discussion_r1517363676
##########
core/src/main/java/org/apache/struts2/dispatcher/multipart/AbstractMultiPartRequest.java:
##########
@@ -337,7 +337,7 @@ public UploadedFile<T>[] getFile(String fieldName) {
*/
public String[] getFileNames(String fieldName) {
return uploadedFiles.getOrDefault(fieldName,
Collections.emptyList()).stream()
- .map(file -> getCanonicalName(file.getName()))
+ .map(file -> getCanonicalName(file.getOriginalName()))
Review Comment:
I think I found where this bug comes from, Commons `FileItem.getName()`
returns:
> Returns the original filename in the client's filesystem, as provided by
the browser (or other client software)
and `UploadedFile.getName()` returns name of the uploaded file on the server
side, so you are right.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]