MIME Multipart Reader
The adapter reads body parts of a multipart message and outputs one or all body parts as text or as a Base64-encoded XML document with header information.
Properties
Operation | Determines which operation the adapter executes Possible values:
|
Parameters
index | Index (position) of the part to be read in for the Possible values:
|
toXML | Output all header information of the multipart message as elements and the content of the read part Base64-encoded in an XML document. Possible values:
|
Status values
1 | The operation was executed successfully. |
0 | The operation was executed successfully, but without any result. |
-1 | The operation failed due to a technical error. |
Examples
The adapter expects a multipart message as input
From: John Doe <example@example.com>
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="XXXXboundary text"
This is a multipart message in MIME format.
--XXXXboundary text
Content-Type: text/plain
This is the body text at index 0
--XXXXboundary text
Content-Type: text/plain;
Content-Disposition: attachment;
filename="test.txt"
This is the body text at index 1
--XXXXboundary text--
GetDocument
The operation GetDocument
reads the following part if the index
parameter is set to 0
and toXML
is set to yes
:
This is the body text at index 0
Traverse
The operation Traverse
reads all parts of the multipart message in a loop one after the other with the help of a Condition
module. The following example has the following parameter configuration: index
= 0
and toXML
= yes
.
In the 1st loop pass the first part (header information and body part) is read in as a base64 encoded element:
<?xml version="1.0" encoding="UTF-8"?>
<document>
<headers>
<header>
<name>Content-Type</name>
<value>text/plain</value>
</header>
</headers>
<content encoding="base64">VGhpcyBpcyB0aGUgYm9keSB0ZXh0IGF0IGluZGV4IDANCg==</content>
</document>
In the 2nd loop pass the second part (header information and body part) is read in as a Base64 encoded element:
<?xml version="1.0" encoding="UTF-8"?>
<document>
<headers>
<header>
<name>Content-Type</name>
<value>text/plain;</value>
</header>
<header>
<name>Content-Disposition</name>
<value>attachment;
filename="test.txt"
</value>
</header>
</headers>
<content encoding="base64">VGhpcyBpcyB0aGUgYm9keSB0ZXh0IGF0IGluZGV4IDENCg==</content>
</document>