cancel
Showing results for 
Search instead for 
Did you mean: 

Mail to File: Use filename from MailBody to store attachement on filesystem

Former Member
0 Kudos

Hi

I have a Mail to File scenario. The mail contains a body and one binary attachment. The goal is to store the binary attachment on the filesystem with a specific filename which should come from the mail body.

So I have to use PayloadSwapBean to have the attachment. But after this I can't access the mail body through a mapping to store the filename from the body content in DynamicConfiguraton (Adapter Specific Message Properties).

How can I transport the filename from the mail body from the mail sender adapter to the file receiver adapter? Is this only possible with an self-written adapter module?

Thx

manuku

Accepted Solutions (0)

Answers (1)

Answers (1)

stefan_grube
Active Contributor
0 Kudos

> How can I transport the filename from the mail body from the mail sender adapter to the file receiver adapter? Is this only possible with an self-written adapter module?

Yes, there is no other way.

http://wiki.sdn.sap.com/wiki/display/XI/AdapterModulePI7.0GetAttachmentName

Former Member
0 Kudos

Hi Stefan

In the meantime I found a very easy solution (without adapter module). The solution was to switch the PayloadSwapBean from the MailSenderAdatper to the FileReceiverAdapter. Due to this small change the mail content was as normal payload present for eg. message mapping. So I was able to use the dynamic configuration to generate the dynamic filename.

This solution is very easy and no development for adapter module is needed.

Thx

Edited by: Tobias Fehringer on Mar 22, 2010 3:09 PM

former_member181962
Active Contributor
0 Kudos

Hi Tobias,

Nice work around. You can probably write a weblog, so that it will be useful for many others.

Regards,

Ravi Kanth Talagana

stefan_grube
Active Contributor
0 Kudos

> In the meantime I found a very easy solution (without adapter module). The solution was to switch the PayloadSwapBean from the MailSenderAdatper to the FileReceiverAdapter. Due to this small change the mail content was as normal payload present for eg. message mapping. So I was able to use the dynamic configuration to generate the dynamic filename.

Hi Tobias,

I should read the requirements more carefully. You wanted the filename from payload, I gave you a solution for reading the attachment name of the mail

Cheers

Stefan