Merge pull request #893 from gregh3269/fix-STRUTS_7_0_0_M3-upload-file-name

Fix original file upload to use actual file name rather than uploadxxx.tmp
This commit is contained in:
Lukasz Lenart
2024-03-08 09:05:41 +01:00
committed by GitHub
@@ -337,7 +337,7 @@ public abstract class AbstractMultiPartRequest<T> implements MultiPartRequest {
*/
public String[] getFileNames(String fieldName) {
return uploadedFiles.getOrDefault(fieldName, Collections.emptyList()).stream()
.map(file -> getCanonicalName(file.getName()))
.map(file -> getCanonicalName(file.getOriginalName()))
.toArray(String[]::new);
}