Multipart Reader
In this article
Overview
You can use this Snap to split a MIME "multipart" binary stream into separate binary documents. A multipart stream is typically generated by HTTP clients, such as web browsers, that need to transfer multiple blobs of data as a single message.
Snap Type
The Multipart Reader is a Transform-type Snap.
Support for Ultra Pipelines
Does not work in in Ultra Pipelines.
Snap Views
Type | Format | Number of Views | Examples of Upstream and Downstream Snaps | Description |
---|---|---|---|---|
Input | Binary |
|
| Binary documents from a Snap with a binary output view or the input view can be left unlinked and used with a Triggered Task to accept POST/PUT requests. |
Output | Binary |
|
| The binary documents that made up the multipart stream. The headers for the binary output documents are taken from the headers in the parts themselves along with the header properties defined in this Snap. If the binary input document is not a multipart stream, it is passed to the output view without processing. |
Error | Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter when running the Pipeline by choosing one of the following options from the When errors occur list under the Views tab:
Learn more about Error handling in Pipelines. |
Snap Settings
Field | Field Type | Description | |
---|---|---|---|
Label*
| String | Specify the name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your pipeline. | |
Content-Type
| String/Expression | Specify the value of the Content-Type header for the binary document. The value of this header is needed to determine whether or not the binary document is, in fact, a multipart stream and what "boundary" is used to separate the parts of the stream. The default value for this property is an expression that fetches the content type from the pipeline parameters (as passed when invoked via a Triggered Task) or the binary input document header. | |
Binary Header Properties
| The binary output document header can be modified by specifying properties in this table property. The headers are initially populated with the headers from the parts in the stream. These properties allow you to pass values from the original multipart input document to the binary output documents. | ||
Expression
| Expression | Specify the expression value to insert into the header. When evaluated, this expression, computes the value to insert.
| |
Target Path
| String/Suggestion | Specify the JSON path where the value should be set in the header. | |
Snap execution
|
| Dropdown list | Select one of the following three modes in which the Snap executes:
|
Example
Post multiple files through the REST client
The following example pipeline demonstrates how to post multiple files using the Content type as Form data through the REST client:
Create a Triggered task for the specific Multipart Reader pipeline. It takes the cloud URL from the Manager and sends the REST pipeline request from the Postman client:
The Snap receives the request from the REST client and displays an output as a multipart output stream:
Three files are passed from the REST Client. These files are merged and displayed as a multipart output stream.
Snap Pack History
Have feedback? Email documentation@snaplogic.com | Ask a question in the SnapLogic Community
© 2017-2024 SnapLogic, Inc.