Skip to Content
Jan 11, 2019 at 10:17 AM

Need the same attachment name in the receiver side (REST to SFTP scenario)


Hi Experts,

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.

UDF code:

  1. String attachmentID =null;
  2. GlobalContainer globalContainer = container.getGlobalContainer();
  3. InputAttachments inputAttachments = globalContainer.getInputAttachments();
  4. if(inputAttachments.areAttachmentsAvailable())
  5. {
  6. Collection<String>CollectionIDs= inputAttachments.getAllContentIds(true);
  7. Object[] arrayObj =CollectionIDs.toArray();
  8. attachmentID =(String)arrayObj[0];
  9. Attachment attachment = inputAttachments.getAttachment(attachmentID);
  10. int attachmentsize = attachment.getContent().length;
  11. return"Attachment Name : "+attachmentID +" Attachment Size : "+attachmentsize+" bytes";
  12. }
  13. else{
  14. return"no attachment found";
  15. }

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.

Please help on fixing in this issue.

Thanks in Advance.

Pavan T