Compression - Decompress

Declaration

<AMCOMPRESSION ACTIVITY="decompress" ARCHIVEFILE="text" DESTINATION="text" TYPE="text (options) " PASSWORD="text (encrypted)" OVERWRITE="YES/NO" CREATEFOLDERS="YES/NO" EXCLUDE="text" RE="YES/NO" />

Related Topics   

Overview

Decompresses one or more compressed files into the specified destination folder. You can use wildcard characters (for example, * or ?) to decompress multiple files matching a certain mask. See File Masks & Wildcards for more information.

Practical usage

Generally used to decompress files received from the Internet using Email, FTP, HTTP, or other means. Can also be used to extract files when restoring from a backup.

Parameters

General

Property Type Required Default Markup Description
Archive file(s) Text Yes (Empty)
  • ARCHIVEFILE="c:\source\file.zip"
  • ARCHIVEFILE="c:\source\*.zip"
The files to decompress. This can be a fully qualified path and file name (preferred) or a single file (requires use of the File System - Change folder activity). You can use wildcard characters (for example, * or ?) to specify all files matching a certain mask. You can specify multiple files and file masks by separating each entry with a pipe (|). For example, c:\temp\*.txt|c:\backup\*.bak. See File Masks & Wildcards for more information.
NOTE: Files with invalid paths are ignored at runtime.
Extract to folder Text Yes (Empty) DESTINATION="c:\myFolder\" The destination folder where compressed files are extracted to. This should be a fully qualified path. Folders that do not exist are created at runtime.
Compression type Text (options) Yes Zip
  • TYPE="jar"
  • TYPE="gzip"
  • TYPE="tar"
  • TYPE="bzip2"
  • TYPE="tar+gzip"
  • TYPE="cab"
  • TYPE="7zip"
Indicates the compression type of the files. The available options are:
  • ZIP (Default)
  • JAR
  • GZIP
  • TAR
  • BZIP2
  • TAR+GZIP
  • CAB
  • 7ZIP
Use this password if needed Text No (Empty) PASSWORD="encrypted" The password (if required) to extract the file. This parameter is required only if a password is set in the properties of the Compress activity.

File Options

Property Type Required Default Markup Description
Exclude mask Text No (Empty)
  • EXCLUDE="*.txt"
  • EXCLUDE="*.txt|*.bak
  • EXCLUDE="c:\foldename"
Omits decompressing files from the archive matching the specified masks. You can use wildcard masks (for example, * or ?). You can specify multiple entries by separating them with a pipe (|). For example, *.txt|*.bak). See File Masks & Wildcards for more details.
Regular expression Yes/No No No RE="YES" If selected, indicates that any value entered in the Exclude mask parameter is interpreted as a regular expression. If disabled (default) the value is interpreted as normal readable text.
Overwrite if exists Yes/No No No OVERWRITE="YES" If selected, indicates if matching files already exist in the destination folder, they should be overwritten. This parameter is disabled by default.
Preserve folder structure Yes/No No No CREATEFOLDERS="NO" If selected, specifies that subfolders present in the archive file should be automatically created and files should be placed in their corresponding subfolders upon decompression. Disabled by default. This parameter is active only if the Include subfolders parameter is selected.

Description

Error Causes

On Error

Example

NOTE:
  • Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
  • To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.

Description

The following sample task decompresses files located in compressed file, overwrites existing files, and excludes the file masks *.jpg

Copy
<AMCOMPRESSION ACTIVITY="decompress" ARCHIVEFILE="c:\temp\ArchiveFile.zip" DESTINATION="c:\TargetFolder\" PASSWORD="AM59xodC/p5p/2PoKyvLlhivPn3CEOXUOFOzKNeFTDC9Rg=aME" OVERWRITE="YES" EXCLUDE="*.jpg" />