You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "Croway (via GitHub)" <gi...@apache.org> on 2025/02/05 14:03:14 UTC
[PR] Add more headers in platform-http multipart uploads [camel-spring-boot]
Croway opened a new pull request, #1366:
URL: https://github.com/apache/camel-spring-boot/pull/1366
(no comment)
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add more headers in platform-http multipart uploads [camel-spring-boot]
Posted by "Croway (via GitHub)" <gi...@apache.org>.
Croway merged PR #1366:
URL: https://github.com/apache/camel-spring-boot/pull/1366
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add more headers in platform-http multipart uploads [camel-spring-boot]
Posted by "Croway (via GitHub)" <gi...@apache.org>.
Croway commented on PR #1366:
URL: https://github.com/apache/camel-spring-boot/pull/1366#issuecomment-2636978958
The failure is expected, and related to the Exchange changes in https://github.com/apache/camel/pull/17070
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add more headers in platform-http multipart uploads [camel-spring-boot]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #1366:
URL: https://github.com/apache/camel-spring-boot/pull/1366#discussion_r1943011060
##########
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:
I think you wanted to use FILE_CONTENT_TYPE
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add more headers in platform-http multipart uploads [camel-spring-boot]
Posted by "Croway (via GitHub)" <gi...@apache.org>.
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org