Skip to Content
avatar image
Former Member

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Sep 12, 2006 at 02:17 PM

    I posted the question to fast 😉

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

    Daniel

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

  • avatar image
    Former Member
    Sep 12, 2006 at 02:23 PM

    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-91c6d38c5816

    Thanks,

    Prakash

    Add comment
    10|10000 characters needed characters exceeded