UnzipFile
Summary
Use the UnzipFile
function to uncompress the contents of a ZIP file located on the Connect SFTP file system. Zip files may contain single or multiple files and nested directory structures.
Syntax
UnzipFile(FilePath='<path to source zip file>, Destination='<target unzip directory location>' [, Overwrite=<true|false>])
Parameters
Parameter | Description |
---|---|
FilePath | (Required) The source ZIP file directory location and file name.
For example:
|
Destination | (Required) The destination directory on the SFTP file system to which the function extracts the uncompressed ZIP file contents. Target file names are determined by the ZIP entries contained in the ZIP file. The function automatically creates the destination directory (and any sub-directories for the ZIP entries) if they do not already exist.
For example:
|
Overwrite | (Optional) Overwrite target files or directories if they already exist on the SFTP file system. The default is false. Note: Do not surround true or false in single quotes. |
Return Type
The function uncompresses the contents of a ZIP file to the Xactly SFTP server file system. The function creates any directories and subdirectories associated with each ZIP entry if not already found on the file system. The function returns a status result set containing information for each ZIP entry included in the source zip file.
Details
Connect is integrated with the Xactly SFTP server, connectftp.xactlycorp.com.
Connect file commands can read and write files and manipulate directory structures located on the SFTP file system. An SFTP account is not required to use these commands. However, an account is required to access the file system using SFTP clients. Contact Xactly Customer Support to set up an SFTP account, if necessary.
You can use an SFTP client to get and put files on the Xactly SFTP server. Valid SFTP login credentials are required to transfer files using SFTP. Connect users, however, do not need SFTP credentials to use Connect file functions with files located on the SFTP server.
Examples
call UnzipFile(FilePath='/inbound_files/raw_orders.csv.zip', Destination='/ready_for_processing', Overwrite=true);
call UnzipFile(FilePath='/all_the_files_and_dirs.zip', Destination='/ready_for_processing', Overwrite=true);
Related Functions