From ca5e82309c3caa1ba91ed5a150d8883317cb5800 Mon Sep 17 00:00:00 2001 From: Greg Huber Date: Thu, 7 Mar 2024 06:08:31 +0000 Subject: [PATCH] Fix file upload to use actual file name rather than uploadxxx.tmp --- .../struts2/dispatcher/multipart/AbstractMultiPartRequest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/apache/struts2/dispatcher/multipart/AbstractMultiPartRequest.java b/core/src/main/java/org/apache/struts2/dispatcher/multipart/AbstractMultiPartRequest.java index 8840ad3d7e..1c91480478 100644 --- a/core/src/main/java/org/apache/struts2/dispatcher/multipart/AbstractMultiPartRequest.java +++ b/core/src/main/java/org/apache/struts2/dispatcher/multipart/AbstractMultiPartRequest.java @@ -337,7 +337,7 @@ public UploadedFile[] 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())) .toArray(String[]::new); }