Zip Task

Overview

Zip Task is SSIS Control Flow task for compression and decompression of Zip, GZip, BZip2, Unix (rfc1950) and Tar archives.

Tip:

If you want to uncompress files created by the standard Unix "compress" utility, get this script.

Setup

Use the General page of the Zip Task Editor dialog to configure the options needed for archive compression and decompression.

Options

Name

Specify task name.

Description

Specify task description.

Action

Specify task action. This property has the options listed in the following table.

Value Description
Compress Compress files into archive.
IsSourceVariable, Source, SourceVariable specify input files.
IsTargetVariable, Target, TargetVariable specify output archive destination.
Decompress Decompress files from archive.
IsSourceVariable, Source, SourceVariable specify input archive file.
IsTargetVariable, Target, TargetVariable specify output files destination.
CompressionType

Specify type of compression or decompression. This property has the options listed in the following table.

Value Description
Zip Type of archive is Zip.
Tar Type of archive is Tar.
CompressionLevel

Visible only when specified action is Compress.
When Zip compression type is selected, the parameter specifies the level of compression.
When Tar compression type is selected, the parameter specifies type of compressor used - GZip, BZip2, Unix, None.

Password

Visible only when specified compression type is Zip. Specify archive encryption password.

IsSourceVariable

Indicates whether the source is stored in a variable. This property has the options listed in the following table.

Value Description
True The source is stored in a variable. Selecting the value displays the dynamic option SourceVariable.
False The source is specified in a File connection manager. Selecting the value displays the dynamic option Source.
Source

Select an existing File connection manager, or click <New connection...> to create a connection manager.

Related topics: File Connection Manager

SourceVariable

Select an existing user-defined variable, or click <New variable...> to create a variable.

Related Topics: Integration Services Variables, Add Variable

RemoveSource

Visible only when specified action is Compress. Specify if task has to remove source files after compression is done.

IncludeSubfolders

Visible only when specified action is Compress. Specify if task has to recursively include all sub-files and sub-folders.

IsTargetVariable

Indicates whether the target is stored in a variable. This property has the options listed in the following table.

Value Description
True The target is stored in a variable. Selecting the value displays the dynamic option TargetVariable.
False The target is specified in a File connection manager. Selecting the value displays the dynamic option Target.
Target

Select an existing File connection manager, or click <New connection...> to create a connection manager.

Related topics: File Connection Manager

TargetVariable

Select an existing user-defined variable, or click <New variable...> to create a variable.

Related Topics: Integration Services Variables, Add Variable

OverwriteExisting

Visible only when specified action is Decompress. Specify if task has to overwrite existing target files.

How to compress multiple files?

You can specify multiple source files for compression in 2 different ways:

  • Specify source file(s) via File Connection Manager.
  • Specify source file(s) via package variable.

The first option is a little bit tricky. If you provide existing file with wildcard specification, the dialog will not validate it. What you need to do is create File Connection Manager to point to existing file. After you close the dialog, right-click on the just created connection manager and click Properties menu. Set ConnectionString property to the required wildcard specification. The Zip Task will now compress all files, which match the specified wildcard.