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   

Description

Decompresses one or more compressed files into the destination folder specified. Wildcard characters (for example, * or ?) may be used to decompress multiple files matching a certain mask. See File Masks & Wildcards for more details.

Practical usage

Generally used to decompress files received from the Internet by way of 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 character (|) (for example, c:\temp\*.txt|c:\backup\*.bak). See File Masks & Wildcards for more details.
NOTE: Files with invalid paths are ignored at runtime.
Extract to folder Text Yes (Empty) DESTINATION="c:\myFolder\" The destination folder in which compressed files should be extracted to. This should be a fully qualified path. Folders that do not exist will be 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 to be decompressed. 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 was previously 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"
Causes this activity to omit decompressing files from the archive matching the masks specified. Wildcard masks (for example, * or ?) may be used. Multiple entries may be specified by separating them with a pipe symbol (|) (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 will be interpreted as a regular expression. If disabled (default) the value will be interpreted as normal readable text.
Overwrite if exists Yes/No No No OVERWRITE="YES" If selected, indicates that 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

This 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" />