cancel
Showing results for 
Search instead for 
Did you mean: 

File with attachment to mail scenario

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (11)

Answers (11)

Former Member
0 Kudos

Hi,

My scenario is file to mail

Iam placing a .txt file in a folder.this file has to get picked by File adapter and then should be sent to email inbox as same .txt attachement.

i have configured the adapter in module tab as

TEST Transform.ContentDescription FileInput

TEST Transform.ContentDisposition attachment

TEST Transform.ContentType text/txt;name="FileInput.txt"

Iam getting an error as "com.sap.aii.utilxi.misc.api.BaseRuntimeException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 69, 6e, 70(:main:, row:1, col:3) at com.sap.aii.mappingtool.tf3.Transformer.checkParserException" in moni.Kindly help me out

Regards

Madhu

Former Member
0 Kudos

Hello MadhuLatha,

Are you not doing any mapping with the file ,If not then what is the need of using messagetransform bean ,When you can send the file as attachment by selecting the messageprotocol as XIPAYLOAD and check keepattachements in the mail adapter.

Let me know if i am not clear or if your req is diff

Regards

Rajesh

Former Member
0 Kudos

Hi Rajesh,

this is my source struture

<File2Mail_SourceMsgType>

<Row>

<Subject/>

<From/>

<To/>

<MailContent/>

</Row>

</File2Mail_SourceMsgType>

target structure

<ns0:Mail xmlns:ns0="http://sap.com/xi/XI/Mail/30">

<Subject/>

<From/>

<To/>

<Content/>

</ns0:Mail>

Regards

Madhu

Former Member
0 Kudos

Check out the below thread

Regards

Rajesh

Former Member
0 Kudos

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

Former Member
0 Kudos

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

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

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

I told you this is your message payload

jpg is not in the payload

you need to do it as I've shown you

I'll try to check changing the name of the jpg today

and I'll let you know if this is possible too

Regards,

michal

MichalKrawczyk
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi Michal,

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

thanks,

Prashanth

Former Member
0 Kudos

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

Former Member
0 Kudos

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

MichalKrawczyk
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

MichalKrawczyk
Active Contributor
0 Kudos

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

MichalKrawczyk
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

stefan_grube
Active Contributor
0 Kudos

Which SP do you use?

Do you have just one file or do you send two fiels from file adapter?

stefan_grube
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi,

Could someone help me out on this?

thanks,

Prashanth