Syntax:
com.ibi.agents.XDAddAttachmentFromFileAgent
iIT Service Object:
attachments: Add Attachment From File
Description:
This service adds a new attachment with the contents determined by the contents of a file. This service is convenient to provide binary data without first going through a Java character set encoding. The attachment headers are specified by the special registers of type HDR in the MIME Header Namespace.
There are also four parameters to specify the most common MIME headers. When used, these parameters override special registers of the same name. Notice the value of the Content-ID header is taken as is, so the value must contain the surrounding angle brackets. For example, a valid value for Content-ID might be <cid>. This service follows the OnSuccess edge upon successful execution, otherwise it follows OnError.
Attachments can have an optional Content_Disposition header, which can be generated and formatted by this service. For example, given a body payload of:
<body>body data</body>
and a file containing:
<mime>attachment data</mime>
Setting the Specific Name of Attachment and Content-Disposition parameters will provide a result as summarized in the following table.
Content Disposition |
Specific Name |
Result |
---|---|---|
none |
none |
------=_Part_0_29701819.1486739647460 Content-Type: application/xml <body>body data</body> ------=_Part_0_29701819.1486739647460 Content-Type: application/xml Content-Transfer-Encoding: 7bit Content-Length: 32 <mime>attachment data</mime> ------=_Part_0_29701819.1486739647460-- |
none |
my_content_name.txt |
------=_Part_2_1555061314.1486739752724 Content-Type: application/xml <body>body data</body> ------=_Part_2_1555061314.1486739752724 Content-Type: application/xml Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=my_content_name.txt Content-Length: 32 <mime>attachment data</mime> ------=_Part_2_1555061314.1486739752724-- |
my_disposition |
none |
------=_Part_4_811251587.1486739819946 Content-Type: application/xml <body>body data</body> ------=_Part_4_811251587.1486739819946 Content-Type: application/xml Content-Transfer-Encoding: 7bit Content-Disposition: my_disposition Content-Length: 32 <mime>attachment data</mime> ------=_Part_4_811251587.1486739819946-- |
my_disposition |
my_content_name.txt |
invalid combination |
Parameters:
Parameter |
Description |
---|---|
Input Data * |
Path to the file that contains the attachment data. |
Content-Type * |
Value of the Content-Type MIME header. |
Content Description |
Value of the Content-Description MIME header. |
Content-Disposition |
Value of the Content-Disposition MIME header. |
Content-ID |
Value of the Content-ID MIME header. |
MIME Header Namespace |
Special register namespace from which additional MIME headers for the attachment are taken. If no value is specified, no MIME headers are added beyond those generated by the header-specific agent parameters. |
Specific Name of Attachment |
The name to be added into a Content_Disposition header if not overridden by the Content Disposition operand. For attachments, this is often a file name. |
Edges:
The following table lists the available line edges for the Add Attachment From File Service (com.ibi.agents.XDAddAttachmentFromFileAgent).
Line Edge |
Description |
---|---|
OnError |
Error |
OnSuccess |
Success |
OnFailure |
Failure |
OnCustom |
|
fail_notfound |
File cannot be located or loaded into the attachment. |
fail_operation |
Other error in creating the attachment. |