Compression - Decompress

 

Declaration

<AMFILESYSTEM ACTIVITY="decompress" SUBFOLDERS="yes/no" OVERWRITE="yes/no" EXCLUDE="text" RE="yes/no" ARCHIVEFILE="text" DESTINATION="text" PASSWORD="text (encrypted)" />

Related Topics   

Description

Decompresses one or more compressed files into the destination folder specified. Wildcard characters (i.e. * or ?) may be used to decompress multiple files matching a certain mask.

Practical Usage

Usually used to decompress files received from the Internet via 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)

  1. FILE="c:\source\file.zip"

  2. FILE="c:\source\*.zip"

The file(s) to decompress. This can be a fully qualified path and filename (preferred) or a single file (requires use of the Change Folder action). Wildcards (i.e. * or ?) may be used to specify all files matching a certain mask. See File Masks & Wildcards for more details.

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

  1. TYPE="zip"

  2. TYPE="jar"

  3. TYPE="gzip"

  4. TYPE="lha"

Indicates the compression type of the file(s) to be decompressed. The available options are:

Zip (Default) | Cab | LHA | Jar | GZip | Tar | Ace | Arj | Arc | Tar+GZip | 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

Include subfolders

Yes/No

No

No

SUBFOLDERS="yes"

If set to YES, subfolders will be included in the extraction.

Preserve folder structure

Yes/No

No

No

CREATEFOLDERS="yes"

If set to YES, specifies that subfolders present in the archive file should be automatically created and files should be placed in their corresponding subfolders upon decompression. Set to NO by default. This parameter is active only if the Include subfolders parameter is set to YES.

Overwrite if exists

Yes/No

No

No

OVERWRITE="yes"

If set to YES, indicates that if matching file(s) already exist in the destination folder, they should be overwritten. This parameter is set to NO by default.

Exclude mask

Text

No

(Empty)

  1. EXCLUDE="*.txt"

  2. EXCLUDE="*.txt|*.bak

  3. EXCLUDE="c:\foldename"

Causes this activity to omit decompressing files from the archive matching the mask(s) specified. Wildcard masks (i.e. * or ?) may be used. Multiple entries may be specified by separating them with a pipe symbol (|) (i.e. *.txt|*.bak). See File Masks & Wildcards for more details.

Regular expression

Yes/No

No

No

RE="yes"

If set to YES, indicates that any value entered in the Exclude mask parameter will be interpreted as a regular expression. If set to NO (default) the value will be interpreted as normal readable text.

 

Description

Error Causes

On Error

example

NOTE: The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.

Description

This sample step decompresses file(s) located in compressed file "c:\temp\ArchiveFile.zip" to "c:\TargetFolder\". It is set to overwrite existing files and exclude the file mask(s) "*.jpg".  

<AMDECOMPRESS ARCHIVEFILE="c:\temp\ArchiveFile.zip" DESTINATION="c:\TargetFolder\" TYPE="zip" OVERWRITE="YES" PASSWORD="AM1TLax4GRtZO1P9mYTOXoER2pY3uoOmE4TaME" EXCLUDE="*.jpg" />