cancel
Showing results for 
Search instead for 
Did you mean: 

Need to get the same name of attachment in a mail

Former Member
0 Kudos

Hi experts,

I have configured a mail to file scenario.The attachment in the mail has to be passed to a file folder.I configured the Mail adapter and used the adapter module Payloadswapbean to get the attachment .And also configured the file adapter with the folder details and provided a name.

Now my requirement has been changed.I want to pass the attachment in the mail to the file folder with the same name as of in attachment.Please provide me any suggestions on how to acheive this.

Thanks,

Tiny

Edited by: TINY MAMPILLY on Jul 15, 2009 8:19 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Tiny

I agree with the guys above it's no easy but You can try use dynamic configuration..like this


    DynamicConfiguration conf = (DynamicConfiguration) container
    .getTransformationParameters()
    .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

 DynamicConfigurationKey key = DynamicConfigurationKey.create(
    "http://sap.com/xi/XI/System/File",
    "FileName");
String fileName = conf.get(key);

Or maybe use a module.

Former Member
0 Kudos

Hi,

Thanks for the replies.

I dont have any mapping in this scenario.

As all of you said, we need to create a adapter module.

I am not an expert in Java,Can anyone please help me to write the Java code for getting the same.

Thanks,

Tiny

stefan_grube
Active Contributor
0 Kudos

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

I think it is not easy. Because, Assume that you pass three attachments in mail with different names. But XI gets that attachments in unique name (Which is mention in Module parameter swap.keyValue) with serial No.

Example: you have mention swap.keyValue is "Attachment". You get the attachments in XI is Attachment1, Attachment2, Attachment3.

So, In custom EJB modue also shows file name for Attachment1, 2, 3.

Thanks & Regards

Vijaykumar

Shabarish_Nair
Active Contributor
0 Kudos

there is no easy way.

Only way is to write an adapter module that will extract the attachment file name. This can be then passed as a field of an xml.

then using dynamic configuration set the file name in the receiver file adapter.

there is a thread that had discussed this earlier -

do refer the same.