File Writer
.This page is no longer maintained (Nov 12, 2025). For the most current information, go to https://docs.snaplogic.com/snaps/snaps-core/sp-binary/file-writer.html.
In this article
Overview
You can use the File Writer Snap to read a binary data stream from the input view and write it to a specified file destination. Possible file destinations include: SLDB, HTTP, S3, FTP, SFTP, FTPS, or HDFS. If you provide file permissions for the file, the Snap sets those permissions to the file.
You must install the AzCopy utility, if you use the ABFS (Azure Blob File Storage) file protocol Azure Data Lake Gen2 for bulk operations. The utility must be installed in Snaplex to fetch the file path. If the path is null, the native Azure Storage SDK is used for all operations. Learn more about the AzCopy command. If AzCopy Utility is not installed for ABS file transfer, the file transfer will not be as fast as using AzCopy because a REST call will be invoked for each file content instead of a bulk operation.
The SnapLogic Platform does not support the installation of utilities or processes on Cloudplexes. Learn more.
Snap Type
File Writer Snap is a Write-type Snap that writes data to the SnapLogic database or external target database.
Prerequisites
Support for Ultra Pipelines
Works in Ultra Pipelines.
Limitations
Files uploaded to SLFS have a 100-MB per file limit. This limit does not apply when writing to external storage.
Do not use SLDB as a file system or storage. File Assets are intended only for specialized files that a pipeline uses to reference certain data, such as accounts, expressions, or JAR files. Use a Cloud storage provider to store production data. File Assets should not be used as a file source or as a destination in production pipelines. When you configure the Writer Snaps, set the file path to a cloud provider or external file system.
Known Issues
This Snap does not create an output file when using the input from SAS Generator Snap configured with only the DELETE SAS permission. This is not the case when the target file exists.
This Snap does not fail and turns green after execution despite providing an expired SAS URI. As a workaround, select Validate after write to fail the Snap in case of invalid credentials.
This Snap Pack does not natively support SHA1-based algorithms to connect to SFTP endpoints. With the August 2023 GA release, you can now leverage the properties specified in the Configuration settings for Snaps to add support for ones that are disabled on your Snaplex.
Snap Views
View Type | View Format | Number of views | Examples of Upstream/Downstream Snaps | Description |
|---|---|---|---|---|
Input | Binary | Min: 1 Max: 1 | Any Snap with a binary output view can be connected upstream, such as CSV Formatter, JSON Formatter, XML Formatter, or File Reader. | Any binary data stream. |
Output | Document | Min: 0 Max: 1 | Downstream Snap is optional. Any Snap with a document input view can be connected downstream. | The output view for this Snap is optional. If an output view is open and the file write action is successful, the output view provides a document with information on the filename, result, and original data. An example is: {
"filename": "ftp://ftp.Snaplogic.com/home/qatest/user_manual.pdf",
"result": "overwritten",
"original": {
"content-type" : "application/json"
}
}The value of the "result" field can be "overwritten", "created", "ignored", or "appended". The value "ignored" indicates that the Snap did not overwrite the existing file because the value of the File action property is "IGNORE". |
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 while 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
Asterisk ( * ): Indicates a mandatory field.
Suggestion icon (
): Indicates a list that is dynamically populated based on the configuration.
Expression icon (
): Indicates whether the value is an expression (if enabled) or a static value (if disabled). Learn more about Using Expressions in SnapLogic.
Add icon (
): Indicates that you can add fields in the fieldset.
Remove icon (
): Indicates that you can remove fields from the fieldset.
Field | Field Type | Description | ||||
|---|---|---|---|---|---|---|
Label*
Default Value: File Writer | String | |||||
File name*
Default Value: None Examples:
Syntax for writing files
| String | Specify the URI of the destination file to which the data (binary input from the upstream input view) is written. It may start with one of the following protocols:
This Snap supports S3 Virtual Private Cloud (VPC) endpoints. For example: s3://my-bucket@bucket.vpce-028b7814794578709-vu0vvauy.s3.us-west-2.vpce.amazonaws.com This Snap supports Oracle Object Storage endpoints when used with pre-authenticated requests. For example: To create a pre-authenticated request, refer to the instructions in the following Oracle article: File Patterns
Learn more about referencing SMB file names: Microsoft's documentation. Learn more: Additional Information. Reading files from Project and Shared Project Spaces
| ||||
Prevent URL encoding | Checkbox | Select this checkbox to use the file path value as-is without encoding the URL. This prevents the Snap from encoding the file path URL (including the query string if any) automatically. Deselect this checkbox to automatically encode the characters in the File URL. | ||||
File action*
Default Value: Overwrite
| Dropdown list | Specify the action to perform if the file already exists. The available options are:
The Append operation is supported for FILE, SFTP, FTP, and FTPS, protocols only. For any other protocols that are not supported by Append, we recommend that you use the File Operations, File Writer, and File Delete Snaps and follow this procedure.
Note: This approach might involve disk overhead, therefore ensure that you have enough disk space in your system.
| ||||
Write empty file
Default Value: Deselected | Checkbox | Select this checkbox to write an empty file when the incoming binary document has empty data. If there is no incoming document at the input view of the Snap, no file is written regardless of the value of the property. | ||||
Write header file
Default Value: Deselected
| Checkbox | Select this checkbox to allow the Snap to write a header file by appending ".header" to the value of the File name property. The same header information is also included in the output view data, as shown in the "Expected output" section above, under the key
| ||||
Validate after write
Default Value: Deselected | Checkbox | Select this checkbox to enable the Snap to check if the file exists after the completion of the file write operation. This may delay a few more seconds for the validation. The write operation occurs when an input document is provided, and validation occurs only after the write operation is successful. | ||||
Number of retries
Default Value:0 | Integer/Expression | Specify the maximum number of retry attempts to make when the Snap fails to write. If the value is larger than 0, the Snap first stores the input data in a temporary local file before writing to the target file.
Minimum value: 0 | ||||
Retry interval (seconds)
Default Value: 1 | Integer/Expression | Specify the minimum number of seconds for which the Snap must wait before attempting recovery from a network failure. Minimum value: 1 | ||||
File permissions for various users
| Use this field set to provide any combination of permissions to the available users.
| |||||
User type
Default Value: N/A | String/Expression/Suggestion | Choose one of the three standard user types. The available options are:
Each row can have only one user type and each user type should appear only once. Select one from the suggested list. Specify at most one row per user type. | ||||
File permissions
Default Value: N/A | String/Expression/Suggestion | Specify the privilege to provide to the user on the file. The available permissions are:
| ||||
Create directory if not present
Default Value: Deselected | Checkbox | Select this checkbox to enable the Snap to create a new directory if the specified directory path does not exist.
| ||||
Flush interval (kB)
Default Value:-1 | Integer | Specify the flush interval in kilobytes during the file upload. The Snap can flush a given size of data output stream written to the target file server. If the value is zero, the Snap flushes in maximum frequency after each byte block is written. Larger the value is, the less frequent flushes the Snap performs. Leave the property at default -1 for no flush during the upload. This property may help if the file upload experiences an intermittent failure. However, more frequent flushes will result in a slower file upload.
| ||||
Advanced properties | Use this field set to add advanced properties, such as SAS URI. | |||||
Properties
Default Value: SAS URI | String | |||||
Values
Default Value: N/A | String/Expression | Specify the value for the SAS URI. When you specify the SAS URI value in the Snap settings, then the settings provided in the account (if any account is attached) are ignored. | ||||
AWS Canned ACL
Default Value: None
| Dropdown list | This field appears only when your account type is set to AWS S3. Select the predefined ACL grant (from AWS) to use when writing a file to S3. Choose a Canned ACL from the available options:
Watch the video below for more information about AWS Canned ACL. Learn more: AWS Canned ACLs. | ||||
Snap Execution
Default Value: Execute only | Dropdown list |
| ||||
Video Demonstration
The following video helps to understand the new AWS canned ACL property.
Watch the following video to understand how to configure the File Writer Snap to write to the S3 Bucket.
Additional Information
You can also access the fields in a binary header when specifying a file name. For example, if you have a File Reader Snap upstream of a File Writer Snap, you can access the "content-location" header field to get the original path of the file. You can then use a new file name based on the old one, for instance, to make a backup file:$['content-location'].match('/([^/]+)$')[1] + '.backup'
For http: and https: protocols, the Snap uses http PUT method only. This property should have the following syntax:
[protocol]://[host][:port]/[path]
Example
For SFTP files, if you attempt to write a file into a directory where you do not have a write access right, the write operation will fail with "access denied" error. When you get an SFTP account credential, it is also important to know where your home directory is, for example, sftp://ftp.snaplogic.com/home/mrtest for username "mrtest"
HDFS Example
For HDFS file access, please use a SnapLogic on-premises Groundplex and make sure that its instance is within the Hadoop cluster and SSH authentication has already been established. You can access HDFS files in the same way as other file protocols in File Reader and File Writer Snaps. There is no need to use any account in the Snap.
HDFS 2.4.0 is supported for the hdfs protocol.
An example for HDFS is:
hdfs://<hostname>:<port number>/<path to folder>/<filename>
If Cloudera Hadoop Name node is installed in AWS EC2 and its hostname is "ec2-54-198-212-134.compute-1.amazonaws.com" and its port number is 8020, then you would enter:
hdfs://ec2-54-198-212-134.compute-1.amazonaws.com:8020/user/john/input/sample.csvHave feedback? Email documentation@snaplogic.com | Ask a question in the SnapLogic Community
© 2017-2025 SnapLogic, Inc.