Zip Activity
The Zip activity enables the compression of specified files or folders into a single archive. This activity is crucial for reducing file sizes, consolidating multiple files, and preparing data for transfer or storage.
| Field | Description | Requirement |
|---|---|---|
| File Name | The path to the file or folder to be compressed. This can include wildcards for batch processing. | Required |
| Zip File Name | The desired name and path for the output .zip archive. | Required |
| Overwrite | Specifies whether to overwrite an existing zip file with the same name at the target location. | Optional |
| Password | An optional password to encrypt the compressed .zip file. | Optional |
Action Types & Examples
File Name
- Format: string (file path pattern)
- Example Result:
"C:\\Temp\\a\\*.txt"
Zip File Name
- Format: string (file path)
- Example Result:
"C:\\Temp\\archive.zip"
Overwrite
- Format: boolean
- Example Result:
true
Password
- Format: string
- Example Result:
"MyS3cr3tP@ssw0rd"
Implementation Examples
Field Setup - File Name: C:\SourceData\*.xlsx - Zip File Name: C:\Archives\MonthlyReport.zip - Overwrite: true - Password: Report@2023
Execution Parameters - Compress all .xlsx files from C:\SourceData\ into C:\Archives\MonthlyReport.zip. - If MonthlyReport.zip already exists, it will be overwritten. - The archive will be protected with the password Report@2023.
Technical Notes
The File Name field supports various path patterns for flexible processing: * Specific file:
C:\Temp\Test.xlsx* Files starting with 'a' and ending with.txtin a folder:C:\Temp\a\*.txt* All.xlsxfiles in a folder:C:\Temp\*.xlsx* All files in a folder:C:\Temp\*.** All files and folders in a directory:C:\Temp\*The Zip File Name must specify the full directory path and include the
.zipextension.The Password field accepts a wide range of characters for encryption, including special characters and accented letters.
The Overwrite parameter dictates behavior when a zip file with the same name already exists: * If
true: If no file with the same name exists, compression proceeds. If a file with the same name exists, the old file is overwritten and the new compression is performed. * Iffalse: If no file with the same name exists, compression proceeds. If a file with the same name already exists in the directory, the activity will not perform the compression and will raise an error with the message "File already exists in directory."