Studio Visual Editor
Field | Value | Description | XML |
---|---|---|---|
Display Name |
Attachment |
Customize to display a unique name for the transformer in your application. |
|
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. |
|
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. |
|
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.) |
|
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 may use a wildcard "" character. For example, a copy-attachments transformer with an attachment name "IMG" will copy 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: text/plain text/css text/javascript text/xml text/xhtml text/html image/jpeg image/gif image/png application/json application/pdf application/x-compressed application/zip multipart/x-zip binary/octet-stream |