Croway commented on code in PR #1366:
URL: 
https://github.com/apache/camel-spring-boot/pull/1366#discussion_r1943021330


##########
components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpBinding.java:
##########
@@ -122,10 +123,13 @@ protected void populateAttachments(HttpServletRequest 
request, Message message)
 
                     if (accepted) {
                         AttachmentMessage am = 
message.getExchange().getMessage(AttachmentMessage.class);
-                        am.addAttachment(name, new DataHandler(new 
CamelFileDataSource(uploadedTmpFile.toFile(), name)));
+                        File uploadedFile = uploadedTmpFile.toFile();
+                        am.addAttachment(name, new DataHandler(new 
CamelFileDataSource(uploadedFile, name)));
 
                         // populate body in case there is only one attachment
                         if (isSingleAttachment) {
+                            message.setHeader(Exchange.FILE_PATH, 
uploadedFile.getAbsolutePath());
+                            message.setHeader(Exchange.FILE_LENGTH, 
multipartFile.getSize());
                             message.setHeader(Exchange.FILE_NAME, 
multipartFile.getOriginalFilename());
                             if (multipartFile.getContentType() != null) {
                                 message.setHeader(Exchange.CONTENT_TYPE, 
multipartFile.getContentType());

Review Comment:
   good catch



-- 
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]

Reply via email to