Zip Task
The Zip task implements a PKZip-compatible Zip compressor and decompressor.
Remarks
The Zip task is used when compressing or decompressing data in the form of files. The task uses the Deflate algorithm specified in RFC 1951 for compression, and produces and reads output compatible with PKZip, WinZip, etc.
Zip Assembler Task
The Assembler takes a group of files as input which contains raw data, and generates a Zip archive file as output.
Compression strength is regulated by the CompressionLevel property. You may also control encryption behavior by setting the Password and EncryptionAlgorithm properties on this task.
Zip Disassembler Task
The Disassembler takes a zipped file as input, and generates a group of unzipped files as output.
The Password property must be set in order to extract files which have been encrypted. You may also use the ExcludedFiles property to regulate which files are to be extracted from the archive.
Assembler Property List
The following is the full list of the properties of the assembler task with short descriptions. Click on the links for further details.
Append | Append files to the specified archive. |
ArchiveFile | The name of the zip archive. |
CompressionLevel | The compression level to use. |
EncryptionAlgorithm | The algorithm used to encrypt a SSIS ADO table when written to the archive. |
ExcludedFiles | A list of files to exclude. |
IncludedFiles | Specifies which files the component should include when compressing. |
LogFile | The file to write logging information to at runtime. |
LogMode | What information gets logged during component execution. |
Other | Defines a set of configuration settings to be used by the task. |
Password | A password for the zip file. |
RecurseSubdirectories | Whether or not to recurse into subdirectories. |
RuntimeLicense | Specifies the component runtime license key. |
ZipComment | The comment for the entire zip file. |
Disassembler Property List
The following is the full list of the properties of the disassembler task with short descriptions. Click on the links for further details.
ArchiveFile | The name of the zip archive. |
ExcludedFiles | A list of files to exclude. |
ExtractToPath | A base path to decompress to. |
FileList | String denoting the name of the variable which contains the last file listing entries. |
FileMask | Specifies which files the component should include when extracting. |
LogFile | The file to write logging information to at runtime. |
LogMode | What information gets logged during component execution. |
Operation | The operation which will be executed by the ZIP task. |
Other | Defines a set of configuration settings to be used by the task. |
OverwriteFiles | Whether or not to overwrite files. |
Password | A password for the zip file. |
RecurseSubdirectories | Whether or not to recurse into subdirectories. |
RuntimeLicense | Specifies the component runtime license key. |
Config Settings
The following is a list of config settings for the task with short descriptions. Click on the links for further details.
CompressionMethod | Used to set the method of compression. |
PlainPassword | Allows you to specify a password stored in plaintext. |
PreserveModifiedTime | Whether or not to preserve the original modified time on extracted files. |
Append Property (Zip Task)
Append files to the specified archive.
Data Type
Boolean
Default Value
false
Remarks
During compression, the files specified by the IncludedFiles property will be appended to the ArchiveFile.
This property is not available in the Disassembler/Decoder.
ArchiveFile Property (Zip Task)
The name of the zip archive.
Data Type
String
Default Value
""
Remarks
This property specifies the name of the archive to be read or written. This property is required when compressing or extracting files.
If scanning or extracting, the file specified by ArchiveFile will be opened for read. If the file does not exist, a trappable error will be generated.
During compression, the file named by ArchiveFile will be written; if a file of this name already exists, the file will be overwritten.
The filename may be specified with or without a path. Paths may be relative or absolute, and should be specified in the format native to the host operating system. The filename should be specified with the appropriate extension (such as "zip"); an extension will not automatically be appended by the task.
If the file cannot be read, or written, as appropriate, a trappable error will be generated.
CompressionLevel Property (Zip Task)
The compression level to use.
Data Type
Integer
Default Value
4
Remarks
This property specifies the level of compression to be used, between 0 and 6. Higher values will cause the task to compress better; lower values will cause the task to compress faster. A value of 0 will store the file without compression.
This property is not available in the Disassembler/Decoder.
EncryptionAlgorithm Property (Zip Task)
The algorithm used to encrypt a SSIS ADO table when written to the archive.
Data Type
Enumeration
Possible Values
Default (0)
AESWeak (1)
AESStrong (2)
AESMaximum (3)
Default Value
0
Remarks
The algorithm used to encrypt each file written to the archive.
Note that the Password property must be set in order for the task to encrypt files. By default the task will use standard zip encryption if Password is set, and will not encrypt data otherwise.
The task supports the use of AES, the Advanced Encryption Standard, as well as standard Zip encryption. The default encryption algorithm is the algorithm introduced in version 2.0 of the Zip specification, and is compatible with virtually all other zip utilities. However, this algorithm is considered weak and should not be used to protect sensitive data.
AES is a U.S. government standard cleared to protect even the most sensitive data. The file format used to create AES-encrypted files is designed to be compatible with WinZip 9.0. AES-encrypted files created by the task may or may not be compatible with other Zip utilities.
The task supports the use of AES with key lengths of 128, 192, or 256 bits. Note that even with the weakest (128-bit) keys, AES is much more secure than standard Zip encryption.
If you use strong or maximum AES encryption, the task will generate a unique salt value and cryptographic key for each file encrypted. If you use weak encryption the task will use the same salt for each file in the archive. If you are encrypting a large number of files, this will have a substantial effect on performance.
If using AES encryption it is important to choose a good Password. For 128-bit keys it is recommended that your password be 32 characters long, and for 256-bit keys, 64 characters.
Important: Note that AES encryption only encrypts the contents of encrypted files within the Zip archive; it does not prevent an attacker from reading the names of files in the archive, or from adding or deleting files to or from the archive. To prevent this consider first storing your files in an unencrypted zip file, and then storing this zipped file in another, AES-encrypted zip file.
Property values:
eaDefault | 0 |
eaAESWeak | 1 |
eaAESStrong | 2 |
etAESMaximum | 3 |
This property is not available in the Disassembler/Decoder.
ExcludedFiles Property (Zip Task)
A list of files to exclude.
Data Type
String
Default Value
""
Remarks
This property specifies files that should be excluded when compressing or extracting a file. When either compression or extraction occurs, each file will be compared to ExcludedFiles, and each file that matches will be excluded.
This property may be set to one or more file names. These file names may be specified with or without a path, and with or without wildcards. If a path is specified, files in the indicated extraction directory will be excluded. If no path is specified but wildcards are, matching files in all directories will be excluded. If a single file name without a path is specified, it must correspond exactly to the appropriate value of a valid file name.
Directories should end with a slash ("/" or "\", as appropriate.) If a directory is specified, all files and subdirectories in the specified directory will be excluded during extraction.
A pipe character ("|") should be used to separate multiple file or directory names.
If the property is set to the empty string, no files will be excluded.
ExtractToPath Property (Zip Task)
A base path to decompress to.
Data Type
String
Default Value
""
Remarks
Setting the ExtractToPath property affects the opExtract Operation. Setting this property to a nonempty string will cause all decompressed files to be written to the specified path. If pathnames are given in the values of decompressed names, they will be regarded as relative to ExtractToPath.
If the specified directory does not exist, it will be created when extraction is done.
ExtractToPath should always be specified in the format native to the host operating system, and with a trailing slash or backslash. If the path is specified otherwise, it will be immediately converted and stored in the converted format. For example, "/temp" would be immediately converted to "\temp\" on a Windows system.
This property is not available in the Assembler/Encoder.
FileList Property (Zip Task)
String denoting the name of the variable which contains the last file listing entries.
Data Type
String
Default Value
"<none>"
Remarks
This property denotes a variable name which contains the collection of file listings returned from the task when the Operation property has been set to opScan. The collection is made up of entries for each listing in the current archive, specified by the ArchiveFile property.
The variable is in the form of a datatable. The table's rows represent a file listing, and the columns represent a different property of the listing. The columns of the datatable are listed below:
(0) CompressedDate | The last modified date of the file, as stored within the archive (it does not generally correspond to when the file was compressed). |
(1) CompressedName | The entry name, as stored within the archive. |
(2) CompressedSize | The size of the compressed data, as compressed within the archive. Headers, footers, etc., are not included in the size. |
(3) DecompressedName | The name of the file in the archive, as stored on the file system, outside the archive. |
(4) DecompressedSize | The size of the file, as decompressed outside the archive. |
This property is read-only.
This property is not available in the Assembler/Encoder.
FileMask Property (Zip Task)
Specifies which files the component should include when extracting.
Data Type
String
Default Value
"*"
Remarks
FileMask may be used to specify which files will be extracted from ArchiveFile during decompression. All other files will be discarded.
The value should be a pipe ("|") -delimited sequence of one or more filenames. The filenames should be specified with paths if necessary.
Filenames may include the wildcards '?', '*', and '< .. >'. '?' will match any single character, and '*' will match an arbitrary sequence of characters. '< .. >' may be used to match any of the characters inside, or a range, such as '<a-z>'.
During extraction, FileMask may be set to one or more filenames or directory names. Files may be specified with or without a path, and with or without wildcards.
Subdirectories will be recursed into if RecurseSubdirectories is set to true.
The ExcludedFiles property may be used to limit the files to be extracted.
This property is not available in the Assembler/Encoder.
IncludedFiles Property (Zip Task)
Specifies which files the component should include when compressing.
Data Type
String
Default Value
""
Remarks
IncludedFiles may be used when compressing to specify the files to be compressed.
The value should be a pipe ("|") -delimited sequence of one or more filenames. The filenames should be specified with paths if necessary, so that the files may be found on the local file system.
Filenames may include the wildcards '?', '*', and '< .. >'. '?' will match any single character, and '*' will match an arbitrary sequence of characters. '< .. >' may be used to match any of the characters inside, or a range, such as '<a-z>'.
If wildcards are specified, the file system will be scanned and all files matching the specified mask will be added to the list of files to compress.
Subdirectories will be recursed into if RecurseSubdirectories is set to true.
The ExcludedFiles may be used to limit the files to be compressed.
This property may also be set to a macro with the variable name that contains the contents of the data to be compressed. The macro must start and end with the '%' character. The compressed filename will be the variable name. The following example shows how to specify a variable name:
Example
Control.IncludedFiles = "%User::MyVariable%"
This property is not available in the Disassembler/Decoder.
LogFile Property (Zip Task)
The file to write logging information to at runtime.
Data Type
String
Default Value
""
Remarks
To write logging information to a file instead of using the task's logging API, set this property to a valid file on disk.
When set, any logging information is appended to the specified file and not written to the task's logging API.
LogMode Property (Zip Task)
What information gets logged during component execution.
Data Type
Enumeration
Possible Values
Verbose (0)
Info (1)
Warning (2)
Error (3)
Fatal (4)
Default Value
3
Remarks
This property controls what information the task logs. The possible values have the following affect on the task's behavior:
Verbose | The task will report all information regarding the transport. |
Info | The task will report all major operations, as well as all warnings and errors. |
Warning | The task will report any conditions that could result in unpredictable behavior as well as errors. |
Error | The task will report all errors that prevent normal operations from completing. |
Fatal | The task will report only serious errors that cause the task to completely stop functioning. |
Operation Property (Zip Task)
The operation which will be executed by the ZIP task.
Data Type
Enumeration
Possible Values
Extract (0)
Scan (1)
Default Value
0
Remarks
There are two different operations that the ZIP Disassemble task may perform. It may extract files, or perform a scan on the entire archive specified by ArchiveFile.
The default for this property is to extract files.
This property is not available in the Assembler/Encoder.
Other Property (Zip Task)
Defines a set of configuration settings to be used by the task.
Data Type
String
Default Value
""
Remarks
The task accepts one or more configuration settings. These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the task, access to these internal properties is provided through the Other property.
The Other property may be set to one or more configuration settings (name/value pairs). Set one setting per line.
For example:
configname1=value1
configname2=value2
OverwriteFiles Property (Zip Task)
Whether or not to overwrite files.
Data Type
Boolean
Default Value
true
Remarks
If this property is set to true, existing files will be overwritten when decompressing. When extracting, each file specified by the FileMask will be checked for existence. If a file exists, the files will be overwritten if OverwriteFiles is set to true.
This property is not available in the Assembler/Encoder.
Password Property (Zip Task)
A password for the zip file.
Data Type
Password
Default Value
""
Remarks
This property specifies the case-sensitive password used to encrypt or decrypt the archive file. If set to an empty string, no password is used.
RecurseSubdirectories Property (Zip Task)
Whether or not to recurse into subdirectories.
Data Type
Boolean
Default Value
true
Remarks
This property affects the behavior of the IncludedFiles and FileMask properties and the meaning of ExcludedFiles property. If this property is set to true, the IncludedFiles and FileMask properties will recurse into all subdirectories whenever it performs a search on the file system.
RuntimeLicense Property (Zip Task)
Specifies the component runtime license key.
Data Type
String
Default Value
""
Remarks
You can use the RuntimeLicense property to set the runtime key for the task license.
ZipComment Property (Zip Task)
The comment for the entire zip file.
Data Type
String
Default Value
""
Remarks
Specifies a global comment for the zip file. Set this property to include a comment in each zipped file the task creates.
This property is not available in the Disassembler/Decoder.
Config Settings (Zip Task)
The task accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the task, access to these internal properties is provided through the Other property.Zip Config Settings
Value | Method |
0 | Deflate (default) |
1 | PPMd |
2 | bzip2 |
PlainPassword=yourpassword
In this case you would not specify any value for Password.
When set to True (default) the extracted files will have the same modified time as the original file.
When set to False the modified time on the extracted files will be set to the current time.