I working a requirement where i need to send the attachment along with the message payload. My scenario is REST to SOAP. I tried below blogs and the code.
- String attachmentID =null;
- GlobalContainer globalContainer = container.getGlobalContainer();
- InputAttachments inputAttachments = globalContainer.getInputAttachments();
- Collection<String>CollectionIDs= inputAttachments.getAllContentIds(true);
- Object arrayObj =CollectionIDs.toArray();
- attachmentID =(String)arrayObj;
- Attachment attachment = inputAttachments.getAttachment(attachmentID);
- int attachmentsize = attachment.getContent().length;
- return"Attachment Name : "+attachmentID +" Attachment Size : "+attachmentsize+" bytes";
- return"no attachment found";
I am not able to get the same attachment name in the receiver and format too.
My source attachment name is : 2365727_E_20181219.pdf and
Target attachment name i am getting is like this. cid%3Aattemail@example.com.
Please help on fixing in this issue.
Thanks in Advance.