cancel
Showing results for 
Search instead for 
Did you mean: 

Getting name of file in an email attachment

Former Member
0 Kudos

I have a sender mail adapter that has been configured to pick up emails with file attachments from a mail box.

The mail adapter passes processing onto the PayloadSwapBean and then onto a customised module that processes the file attachment (a CSV file).

When I use the messaging system i.e. http://xiserver:port/MessagingSystem/monitor/monitor.jsp

I see the following output, which includes the attachment's file name in the Content-Type i.e. INV_5016888091848_20060912_00001.csv

Content-Type: application/octet-stream;name="INV_5016888091848_20060912_00001.csv"

Content-Disposition: attachment;filename="MailMessage.bin"

Content-Description: MailMessage

In my customised module I have attempted to pick up this file name from the payload using the "getContentType" method of the "XMLPayload" class but this only returns "application/octet-stream" and does not include the file name.

Does anyone know how I can get hold of the above file name using the Adapter Framework API?

Accepted Solutions (0)

Answers (3)

Answers (3)

stefan_grube
Active Contributor
0 Kudos

Look at this note: 960502

I Have not tested this, but it seems to be useful in this case.

Regards

Stefan

Former Member
0 Kudos

Hi Stefan,

we have all necessary patches installed. But xi does not bind the name of the payload to the content description(how it is mentioned in note 960502). I guess we have to set the parameter XI.BindPayloadName explicitly. But where do I set this parameter exactly?

Thx,

Steffen

stefan_grube
Active Contributor
0 Kudos

Add the value to the 'Additional parameters' section at the bottom of the channel config.

But unfortunately it seems not to have any effect on the methods in the adapter module

Regards

Stefan

Former Member
0 Kudos

Okay ... I give up ... There's nothing else for it but to sit and wait for an adapter-specific message property.

Thx again,

Steffen

Former Member
0 Kudos

Hi again,

plz let me know if you found a solution for it. Points are waiting for you ;-).

-Steffen

Former Member
0 Kudos

Hi,

Have you tried the following...

In the adapter module that you wrote, did you try calling the method 'getSupplementalDataNames() ' of the 'ModuleData' class ??

I am assuming all the attachment details should be available in the enumeration this method returns...please let me know...

My reasoning that it might work is that the 'PAYLOADswapbean' is somehow reading all the attachments details..which technically we should be able to do if we wrote an adapter module on our own....

I did not get time to try this out..please check if this helps....

Thanks.

Former Member
0 Kudos

Hi Simon,

I experienced the same problem. I think there is no solution yet. I guess we have to sit and wait till SAP implement it graciously. I hope they will extend the adapter-specific message properties so we can grep the holy name of the attachment finally.

And the problem continuous successfully ...

-Steffen