Task Factory Compression
Compression Task
Task Icon |
Task Description |
|
The Compression Task is used to either compress or decompress a file. |
General
Task Action
Option |
Description |
Task Action
|
There are two options for the Task Action:
|
Source Files or Directory
Option |
Description |
Source stored in variable?
|
Selecting this checkbox replaces the Source Connection Manager with Select Source Variable and the drop down populates with all of the user created string variables within your package. The task expects the variable to contain the file or directory path to be compressed / decompressed. |
Source connection manager
|
Available if Source stored in a variable is not selected. The source connection manager selected contains the path to the file or directory (zip compression only) that is used for compression / decompression. If you do not have an existing File or flat file connection you wish to use, you can create one here. |
Include Sub directories?
|
Available only for Zip Compression. Selecting this option includes all subdirectories within the selected variable or connection manager path. |
Destination File or Directory
Option |
Description |
Destination stored in a variable?
|
Selecting this checkbox replaces the Destination Connection Manager with Select Destination Variable and the drop down includes all of the user created string variables within your package. The task expects the file or directory to be compressed / decompress to be defined in the variable selected. |
Destination connection manager
|
Available if Destination Stored in Variable is not selected. The destination connection manager should point to the connection manager that points to the file or directory (zip compression only) that is used for compression / decompression. If you do not have an existing file or flat file connection you wish to use, you can create one here.
Important: The only connection manager options that can be used for compressing are Create File and Existing File.) |
Overwrite destination file
|
Select this if you want the compression task to overwrite the file if it already exists. If this option is not selected and the file already exists, an exception is thrown. |
Expressions
Additional Information: See the
Expressions article for more information on using the
Expressions button functionality.
Advanced
Compression Settings
Option |
Description |
Compression Type
|
There are four compression algorithms that can be used:
|
Zip Settings (Available only for Zip Type)
Option |
Description |
Compression Level
|
Sets the level of compression to be used during the compression process.
- None - No compression occurs. The files and directories are added to the zip file only.
- Fast - A small amount of compression occurs but the compression time is fast.
- Normal - The normal level of compression is used.
- Above Normal - A slightly above normal level of compression is used. The compression time is slower.
- Maximum - The maximum amount of compression occurs. The compression time is slower than all of the other levels.
|
Password
|
If used with a Task Action of Compress, the password specified is added to the zip file. This password is necessary to open the zip file by any end user. If used with a Task Action of Decompress, the password is used to decompress the file selected as the source file. |
Create Self-Extracting EXE
|
Selecting this option creates a self-extracting exe instead of a zip file. |
Temporary Directory
|
Enter here the directory where the temporary files are created during compression. If left blank it uses the default location. |
Character Encoding
|
Specifies the character coding to be used in the archive. |
Samples
See the taskfactory-samples repository on GitHub for the following Compression Task samples:
- 1_SetupCompressionTaskDirectory.dtsx - Use to set up the compression samples
- CompressionTask_Compress.dtsx - Compression task configured to compression files into a zip file
- CompressionTask_Decompress.dtsx - Compression task configured to decompress files from a zip file