Skip to Content
avatar image
Former Member

File with attachment to mail scenario

Hi,

I am working on a scenario where I am configuring a file adapter to carry an XI payload along with a .jpg attachment. This is received by a mail adapter.

I have used a standard ejb on my mail receiver adapter side, where I have given the following specifications for my attachment

Transform.ContentDescription Filename.jpg

Transform.ContentDisposition attachment

Transform.ContentType image/jpeg

I have given a random module key in the configuration.(say 1)

The processing sequence is

1) attachment module

2) mail module

I am receiving the attachment as <b>filename.jpg.jpg</b> and it shows 250 Bytes in the mail whereas the actual size of the .jpg being sent is about 80 Kb.

Also, if i download this file, it says the size is 0 Kb.

Is the file getting corrupted somewhere?

Please let me know what the problem could be.

Thanks,

Prashanth

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

11 Answers

  • avatar image
    Former Member
    Apr 14, 2006 at 12:17 AM

    Hi,

    Could someone help me out on this?

    thanks,

    Prashanth

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 14, 2006 at 05:11 PM

    Hi Prashanth,

    1. The filename of the attachment is assembled from descriprion + content type. So set the description to filename without suffix.

    2. The file has to be declared as binary in the file adapter settings. Otherwise the file adapter tries to convert the file to UTF-8, which does not make any sense with non-text files.

    Regards

    Stefan

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 14, 2006 at 07:04 PM

    Hi Stefan,

    Thanks a ton for your answer. I tried out as you told me to, but I am still not able to get the attachment in its initial size.

    I presume that it is getting corrupted on the way somewhere, but I cant figure out where.

    Could you help me out on that?

    Thanks,

    Prashanth

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 15, 2006 at 02:24 PM

    hi,

    >>>>I am working on a scenario where I am configuring a file adapter to carry an XI payload along with a .jpg attachment

    so you have xml + jpg right?

    >>>I am receiving the attachment as filename.jpg.jpg and it shows 250 Bytes in the mail whereas the actual size of the .jpg being sent is about 80 Kb.

    how big is your xml file?

    try downloading the filename.jpg.jpg and savinf it

    as xml and check if you can open it

    maybe it's not the jpg but xml saved with jpg extension

    check it and let me know

    BTW

    your scenario works at my dev XI

    Regards,

    michal

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 15, 2006 at 09:51 PM

    Hi Michael,

    It doesnt open as an XML also.

    Great that it works on urs, but are u able to retrieve the file? Does the jpg come in as an attachment?

    cheers,

    Prashanth

    Add comment
    10|10000 characters needed characters exceeded

    • Hi,

      >>>Does the jpg come in as an attachment?

      yes it does when I change the content type

      to image/jpeg in a simple adapter module

      I can see a jpg in the attachment and when I open

      it it's the same one as the one that was

      pulled by the file adapter

      I only had problems with the jpg's name

      but I believe it can also be solved easily

      and I'll try to do it after Easter 😊

      Regards,

      michal

  • avatar image
    Former Member
    Apr 17, 2006 at 03:56 AM

    Hi Michal,

    First of all, a very happy Easter to you!

    I am getting the attachment as file.jpg(200Bytes) with the mail, but when I download it, it shows 0 bytes.

    😔

    Could you tell me where I could have made a mistake?

    thanks,

    Prashanth

    Add comment
    10|10000 characters needed characters exceeded

    • Hi,

      try changing the content type

      in the adapter module 200bytes is not a size of

      a jpg file probably so you're probably not getting the jpg

      just do as I did and it will work for sure

      Regards,

      michal

  • avatar image
    Former Member
    Apr 17, 2006 at 07:33 AM

    Hi Michal,

    My content type is image/jpeg.

    Is that right??

    Also, Do I specify the file to be picked as file.jpg or just file(without the extn)??

    thanks,

    Prashanth

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 17, 2006 at 07:35 AM

    Hi Michal,

    Also, when I am specifying the params for additional files, what do I give in the file.encoding?

    thanks,

    Prashanth

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 17, 2006 at 07:49 AM

    Hi Michal,

    One more thing... You were right.. I downloaded the attachment again now.., and saved it as .xml. It shows my target mapping xml

    What did I do wrong?

    cheers,

    prashanth

    Add comment
    10|10000 characters needed characters exceeded

    • UPDATE 😊

      you can set the name of the original jpg too 😊

      but I only managed it by copying it

      (inside the mail adapter module)

      and setting a new name + content from the original jpg file

      but it works 😊

      Regards,

      michal

  • avatar image
    Former Member
    Apr 17, 2006 at 12:47 PM

    hi Michal,

    Done deal..I used payload swap bean instead of message transform and got the jpeg payload as a .xml file.

    When i save it as .jpg, I get the jpeg file.

    What parameter do i use in payload swap bean to get the jpg directly as the attachment, and not as an XML?

    thanks,

    Prashanth

    Add comment
    10|10000 characters needed characters exceeded