Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In this article

Table of Contents

Overview

You can use this Snap to extract files from an archive file and write them to the binary output view.

Note
The archive format is automatically detected by examining the file header.  The supported formats are PKZIP and 7-Zip. 

Image Added

Snap Type

ZipFile Read Snap is a READ-type Snap that reads files from an archive files.

Prerequisites

Multiexcerpt include macro
nameEC2Prerequisite
pageFile Reader

Support for Ultra Pipelines

 Does not support Ultra Pipelines

Limitations and Known Issues

None.

Snap Views

Type

Format

Number of Views

Examples of Upstream and Downstream Snaps

Description

Input 

Document



  • Min: 0
  • Max: 1
Upstream Snap is optional. Any Snap with a document output view can be connected upstream.

The Snap does not require input data. Input documents may be used to evaluate any JavaScript expression in the File property.

It may contain value(s) to evaluate the JavaScript expression in the File property.

Output

Binary



  • Min: 1
  • Max: 1
  • File Writer
  • Binary Router
  • JSON Parser.

Binary data read from the source specified in the File property with header information about the binary stream.

Each file extracted from the provided zip file is written as binary object to this output view. The header of the binary object has details about the file extracted like content-location, content-type, content-length, last-modified, and zip-filename.

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. The available options are:

  • Stop Pipeline Execution: Stops the current pipeline execution when the Snap encounters an error.

  • Discard Error Data and Continue: Ignores the error, discards that record, and continues with the rest of the records.

  • Route Error Data to Error View: Routes the error data to an error view without stopping the Snap execution.

Learn more about Error handling in Pipelines.

Account

This Snap uses account references created on the Accounts page of SnapLogic Manager to handle access to this endpoint. This Snap supports a Basic auth account, an AWS S3 auth account, SSH Auth account, SMB account, or no account. See Configuring Binary Accounts for information on setting up accounts that work with this Snap.

Account types supported by each protocol are as follows:

Protocol Account types
sldbno account
s3AWS S3
ftpBasic Auth
sftpBasic Auth, SSH Auth 
ftpsBasic Auth
hdfsno account
httpno account
httpsno account
smbSMB
wasbAzure Storage
wasbsAzure Storage
gs

Google Storage

Required settings for account types are as follows:

Account Type Settings
Basic AuthUsername, Password
AWS S3Access-key ID, Secret key
SSH AuthUsername, Private key, Key Passphrase
SMBDomain, Username, Password
Azure Storage

Account name, Primary access key

Google StorageApproval prompt, Application scope, Auto-refresh token
(Read-only properties are Access token, Refresh token, Access token expiration, OAuth2 Endpoint, OAuth2 token and Access type.)


Snap Settings

File Reader

Field Name

Field Type

Description


Label*


Default ValueZipFile Read
Example
:ZipFile Read

StringSpecify 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 pipelinePipeline.

File*


Default value: [None] 
Example
:Contact.zip


String/Expression

Specify the URL for the zip file source. It should start with a file protocol. The supported file protocols are:

  • http
  • https
  • s3
  • sftp
  • ftp
  • ftps
  • sldb
  • smb
  • wasb
  • wasbs
  • gs
Note

The FTPS file protocol works only in explicit mode. The implicit mode is not supported.


Prevent URL encoding


Default value: Not selected


Checkbox


Excerpt

When enabled, this will Select this checkbox to prevent the Snap from automatically URL encoding the URL file path (including the query string if it exists) . Enable this setting to and use the file path value as-is.  

When disabled, the Deselect this checkbox to encode the URLs. The following are some of the common characters that are automatically encoded by the Snap:

Character name Character  URL Encoded value
backslash      \ %5C
Pound #    %23
space       
 %20 
 percent    %     %25 
Left-angle<%3C
Right-angle>%3E
Left-angle[%5B
Right-square]%5D
Right-curly{%7B
Right-curly}%7D


And these are some of the characters that are not automatically encoded by the Snap:

Character name Character  URL Encoded value

semi-colon    

 ;   

 %3B

question mark     

?

 %3F

forward slash      

/

 %2F

colon       

 : 

  %3A 

ampersand      

 &  

%26

equals   

 =  

%3D

plus        

+  

%2B

dollar   

 $    

 %24

comma  

   ,     

%2C


  


Number of retries


Default value: 0
Example:  3



Integer/Expression

Specifies Specify the maximum number of retry attempts that the Snap must make in case there is a network failure, and the Snap is unable to read the target file.

If the value is larger than 0, the Snap first downloads the target file to a temporary zip file. If any error occurs during the download, the Snap waits for the time specified in the Retry interval and attempts to download the file again from the beginning. When the download is successful, the Snap starts to unzip the data and stream the data from the temporary file to the downstream Pipeline. All temporary local files are deleted when they are no longer needed.

Info

Ensure that the local drive has sufficient free disk space to store the temporary local file.

Minimum value: 0

Multiexcerpt include macro
nameretries
page

Retry interval (seconds)


Default value: 1
Example
: 3

Integer/Expression

Specifies Specify the minimum number of seconds for which the Snap must wait before attempting recovery from a network failure.

Minimum value: 1

Advanced propertiesUse this field set to define additional properties for the Snap.
SAS URIDropdown

Multiexcerpt include macro
nameSASURI_Description
pageFile Reader

Note

If you specify the SAS URI value is provided in the Snap settings, then the settings provided in the account (if any account is attached) are ignored.


ValuesString/ExpressionProvide a value for the SAS URI.

Snap Execution

Dropdown list

Multiexcerpt include macro
nameSnap_Execution_Introduced
pageAnaplan Read

Note

The 'IAM_CREDENTIAL_FOR_S3' feature is to access S3 files from EC2 Groundplex without  Access-key ID and Secret key in the AWS S3 account in the Snap. The IAM credential stored in the EC2 metadata is used to gain the access rights to the S3 buckets. To enable this feature, the following line should be added to global.properties and restart the JCC:

 jcc.jvm_options = -DIAM_CREDENTIAL_FOR_S3=TRUE
NoteThis feature is supported in the EC2-type Groundplex only.



Insert excerpt
Binary Snap Pack
Binary Snap Pack
nopaneltrue