This is an automated email from the ASF dual-hosted git repository.

zhfeng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git


The following commit(s) were added to refs/heads/main by this push:
     new 7f9f4f430ea CAMEL-21557: camel-platform-http-starter - improve to use 
a unique filename for the uploadedTmpFile (#1308)
7f9f4f430ea is described below

commit 7f9f4f430ea8c9d1deed9710fe0d08b6f14e84a3
Author: Zheng Feng <[email protected]>
AuthorDate: Wed Dec 18 14:59:58 2024 +0800

    CAMEL-21557: camel-platform-http-starter - improve to use a unique filename 
for the uploadedTmpFile (#1308)
---
 .../platform/http/springboot/SpringBootPlatformHttpBinding.java        | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpBinding.java
 
b/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpBinding.java
index 04a35f36e09..d5e493a28b4 100644
--- 
a/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpBinding.java
+++ 
b/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpBinding.java
@@ -42,6 +42,7 @@ import java.nio.ByteBuffer;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.Locale;
+import java.util.UUID;
 
 public class SpringBootPlatformHttpBinding extends DefaultHttpBinding {
     private static final Logger LOG = 
LoggerFactory.getLogger(SpringBootPlatformHttpBinding.class);
@@ -76,7 +77,7 @@ public class SpringBootPlatformHttpBinding extends 
DefaultHttpBinding {
             File tmpFolder = (File) 
request.getServletContext().getAttribute(ServletContext.TEMPDIR);
             multipartHttpServletRequest.getFileMap().forEach((name, 
multipartFile) -> {
                 try {
-                    Path uploadedTmpFile = Paths.get(tmpFolder.getPath(), 
name);
+                    Path uploadedTmpFile = Paths.get(tmpFolder.getPath(), 
UUID.randomUUID().toString());
                     multipartFile.transferTo(uploadedTmpFile);
 
                     if (name != null) {

Reply via email to