Skip to Content
0

Issue getting the additional filename details pulled from SFTP Sender Channel.

Dec 01, 2016 at 11:09 PM

164

avatar image
Former Member

Hi All,

I have a scenario to pull one .XML file as main payload and multiple .doc / .pdf / .jpg files as attachments.

Configured SFTP sender to have additional files to pull attachments in the message.

The issue here is all the attachment's content type are getting defaulted to (application.xml) irrespective of the attachment extensions (.pdf,.jpeg..) which is causing an issue while sending it to target system.

The dynamic configuration in SFTP channel has no details of the additional files, the only details available are of the actual file.

Is there a way where we can get the additional file name details in dynamic configuration ? or a way to get the attachment name within java mapping so that I can set the content type reading each attachment name.

Couldn't find any option to get the attachment name within the API.

Thanks in advance.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Manoj K Dec 02, 2016 at 02:57 AM
1

Add multipartheaderbea in sender channel and you can see the attachment name in DC then you may read those via java in mapping.

https://archive.sap.com/discussions/thread/3956705

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Manoj,

Thanks for the inputs , adding the MultipartHeaderBean worked in setting up the dynamic configuration for the additional files read from SFTP.

http://sap.com/xi/XI/System" name="Part[1].Content-Disposition">attachment;filename=" PO_12345.pdf"

http://sap.com/xi/XI/System" name="Part[2].Content-Disposition">attachment;filename="PO_12345.jpg"

0
Evgeniy Kolmakov Dec 02, 2016 at 03:26 AM
0

Hi Kowshik!

Manoj is absolutely right: you can add attachment's properties to Dynamic Configuration using MultipartHeaderBean.

Another option is to use custom adapter module to get the same data using com.sap.engine.interfaces.messaging.api.Payload class to read attachment's properties.

Regards, Evgeniy.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Evgeniy,

Thanks for your time in replying , As suggested by Manoj "MultipartHeaderBean" did the trick and relied on java mapping to read the filename from the dynamic configuration.

Regards,

Kowshik.

1