Studio Visual Editor
Field | Description |
---|---|
Display Name |
Attachment - Customize to display a unique name for the transformer in your application. doc:name="Attachment" |
Operation |
Set Attachment - Select to set a new attachment on the outbound scope of your message.
|
Remove Attachment - Select to delete an existing attachment from your message to remove it from the outbound scope.
|
|
Copy Attachments - Select to copy one or more existing attachments from the inbound scope onto the outbound scope of your message.
|
|
Name |
String or Mule Expression - Specify the name for the attachment that you are creating, or identify the name of the attachment that you are copying or removing. If you are copying or removing attachments, this field accepts a wildcard "*" character. attachmentName="MyAttachmentName" |
Value |
String or Mule Expression - This field displays only if you are setting a new attachment. Specify the value using either a string or a Mule expression. value="MyAttachmentValue" |
Content Type |
Select from drop-down list - This field displays only if you are setting a new attachment. Select the content type of the attachment from the drop-down list (shown in screenshot above.) contentType="text/plain" |
XML Editor or Standalone
# Set attachment
<set-attachment attachmentName="IMG_001" doc:name="Attach Photo" value="IMG_001.jpeg"/>
# Remove attachment
<remove-attachment attachmentName="AttachmentForRemoval" doc:name="Delete Attachment"/>
# Copy attachment
<copy-attachments attachmentName="IMG*" doc:name="Copy All IMG Attachments"/>
Element | Description |
---|---|
set-attachment |
Set a new attachment on the outbound scope of your message. |
remove-attachment |
Delete an existing attachment from your message to remove it from the outbound scope. |
copy-attachments |
Copy one or more existing attachments from the inbound scope onto the outbound scope of your message. |
Element Attribute | Description |
---|---|
doc:name |
Customize to display a unique name for the transformer in your application, as shown in the examples above. Note: Attribute not required in Mule Standalone configuration. |
attachmentName |
The name of the attachment that you are setting, copying, or removing. Can be a string or a Mule expression. Note: If you are using the remove-attachment or copy-attachments element, you can use a wildcard "" character. For example, a copy-attachments transformer with an attachment name "IMG" copies all attachments whose names begin with "IMG", from the inbound scope to the outbound scope. |
value |
The value of the attachment that you are setting. This attribute is only relevant for the set-attachment element. Can be a string or a Mule expression. |
contentType |
The MIME format for the attachment string. Supported formats:
|