cancel
Showing results for 
Search instead for 
Did you mean: 

Different Attachment extension(.xls,.txt) in sender mail adapter

ayan_chaudhuri
Participant
0 Kudos

Hi Experts

Is it possible to use different type of attachment extension (e.g .xls,.txt) in the sender mail adapter?

My requirement is , the attachment in the mail adapter will be used as the main payload.So I am using PayloadSwapBean adapter module.

Currently I am using the following module key for .xls attachment and it is working.Configuration for .xls attachment is as follows

swap.keyName-Content-Disposition

swap.keyname-Content-Description

swap.keyName-Content-Type

swap.keyValue-attachment;filename="MailAttachment-1.xls"

swap.keyValue-MailAttachment-1

swap.keyValue-application/vnd.ms-excel.

Now, the attachment may be .xls or .txt file.

Now If I want to use .txt atachment then do I need to define all these parameter again and in that case what will be my content type for .txt file.

Your inputs required

thanks

Ayan

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member200962
Active Contributor
0 Kudos

Excel attachment can surely not be read using the payloadswapbean....you need to have a module to read the contents of a Excel file.

ayan_chaudhuri
Participant
0 Kudos

PayloadSwapBean will only convert the attachment as the main payload.

Yeah for reading excel file I have a separate custom adapter module.This is not in the scope of my question..

All I am asking , can .txt as well as .xls attachment be used in the same sender mail adapter.

If that is possible what will be my content-type for .txt or can I remove content-type and use only content-disposition and content-description so that any type of attachment it can recognise.

The momment I am specifying content-type , I am making it particular that only say .xls attachment , it will identify.

I hope I make you clear.Inputs required

Thanks

Ayan

Former Member
0 Kudos

Hi,

If that is possible what will be my content-type for .txt ?

text/plain

Please refer this

http://www.iana.org/assignments/media-types/

When u configure for both the .xls and .txt then header of the payload is searched in order and the system takes the first payload that meets the criteria,then payload is swapped with the application payload.

Babu

former_member200962
Active Contributor
0 Kudos
All I am asking , can .txt as well as .xls attachment be used in the same sender mail adapter.

PayloadSwapBean does not support multiple attachments....you have to develop your own module and then process accordingly....for more info refere the comment section (Multiple Attachments) of this blog: /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step

Regards,

Abhishek.