Skip to content

Commit

Permalink
CAMEL-21557: camel-platform-http-starter - improve to use a unique fi…
Browse files Browse the repository at this point in the history
…lename for the uploadedTmpFile (apache#1308)

(cherry picked from commit 7f9f4f4)
  • Loading branch information
zhfeng authored and luigidemasi committed Dec 18, 2024
1 parent b4d59ea commit 4802522
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
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);
Expand Down Expand Up @@ -86,7 +87,7 @@ protected void populateAttachments(HttpServletRequest request, Message message)
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) {
Expand Down

0 comments on commit 4802522

Please sign in to comment.