cancel
Showing results for 
Search instead for 
Did you mean: 

Mail-Adapter adds ".bin" to filename of attachment

Former Member
0 Kudos

Hi!

I'm sending mails with a dynamic generated filename using the mail-adapter and mail-package. The file extension of the attachment should be ".txt" and the content-type should be "application/EDIFACT"

When I change the content-type of the attachment in my adapter module by

...

TextPayload attachment = msg.createTextPayload();

attachment.setName("something_dynamically_generated.txt");

attachment.setContentType("application/EDIFACT");

...

The content-type is changed properly, but the file extension ".bin" is added.

The result is in my example:

something_dynamically_generated.txt.bin

How can I stop XI from extending my filename?

I tried with the MessageTransformBean, but it had no effect.

Best regards,

Daniel

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member206604
Active Contributor
0 Kudos

Hi,

Try changing the content type like text/plain.

Also check out this doc might be helpful

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/6d967fbc-0a01-0010-4fb4-91c...

Thanks,

Prakash

Former Member
0 Kudos

I posted the question to fast

The problem is solved... It seems that this behaviour is changed between SP15 and SP18.

Daniel

Former Member
0 Kudos

Hi Daniel,

Could u tell me in what SP the issue is solved and what is the configuration for the scenario(mail adapter Config).

Regards,

Sudharshan

Former Member
0 Kudos

Hi Sudharshan,

we upgraded from SP15 to SP18, then the problem occured no more.

I created the attachment in an adapter-module for the mail adapter. Sample code:

TextPayload attachment = msg.createTextPayload();

attachment.setContentType("Application/EDIFACT");

attachment.setName("SomethingDynamicallyGenerated.txt");

attachment.setText(string_which_contains_the_new_payload);

msg.addAttachment(attachment);

It seems that the mail adapter checks now if a filename extension is given. If this is the case, it adds no extension by itself.

I tested different configurations like mail package and variable transportbinding / adapterspecific attributes, it worked every time.

Best regards,

Daniel