Compression Action
(Requires EAM) Occasionally,
users might upload or download files that need to be compressed (for example, zipped) or decompressed (for example, unzipped) before transferring. The Compress/Decompress
Action can be used to compress and decompress files. You can compress/decompress
the following formats: ZIP, 7Zip, GZip, BZip2, Tar, Tar and GZIP, and
ZCompress.
-
To ensure maximum compatibility with third-party archival tools, Unicode passwords should be avoided.
-
The Source and Destination file path specifications are limited to physical paths only – virtual paths will not work for these fields.
-
For GZip format, add a trailing slash to the Destination path to make it explicitly clear that the destination is to be interpreted as a folder. If Overwrite is set to never, no error occurs, and the Action completes by removing the original GZip file.
-
Decompress Action Destination Paths and Trailing slashes (\):
-
For Zip, Tar, and 7zip archive formats it doesn’t matter if the trailing \ is there, because the path will always be treated as the folder in which to decompress the entire archive. The exception to this is if the “< >” syntax is used where individual archive files and their destinations paths can be specified.
-
For Gzip, Bzip2, and “Tar and Gzip” (and ZCompress with or without trailing \) archive formats, only a single file whose name is the last part of the destination path will be extracted, decompressed, and saved into the parent folder specified in the destination path. So, if the destination path is given as “c:\myFolder\myFile”, then a file named “myFile” will be extracted from the specified source archive, decompressed, and placed in “c:\myFolder” (with the same name).
If a user wants to decompress an entire archive and place it into a folder, using a destination path with a trailing slash (\) will always accomplish this. This is the typical use case and is shown in the example below the destination field. The only exception is if ZCompress is used, in which case the behavior is the same as for Zip, Tar, and 7zip as described below. If the trailing \ is missing, the behavior depends on the decompression format used:
To compress or decompress files using Event Rules
-
Add the Event to the Event Rule (for example, File Downloaded).
-
Add any (optional) Conditions.
-
Add the Compression Action.
-
Click any links in the action to open the Compress/ Decompress dialog box.
-
In the Action list, click the desired Action: Compress or Decompress.
-
In the Format box, specify the format in/from which to compress or decompress the file: ZIP, 7Zip, GZip, BZip2, Tar, Tar and GZIP, and ZCompress.
-
If the Compress Action is specified, in the Method list, specify the Method: Deflate or PPMd.
-
If the Compress Action is specified, in the Level list, specify a level of compression to apply, from 0 - fastest to 6 - densest.
-
If the Decompress Action is specified, the Method and Level lists are unavailable.
-
In the Files area, specify the Source and Destination paths. (As noted above, only physical paths should be specified; virtual path will not work.)
-
Select the variable drop-down list (percent sign %) to specify a context variable. You can specify more than one and use wildcards, as shown in the examples.
-
Select the folder icon to browse to a folder. Add a trailing slash to the Destination path to make it explicitly clear that the destination is to be interpreted as a folder.
-
In the Options area, the Overwrite options (Never, Always, If Newer). If Newer is available when the Decompress Action is specified.
-
Select the check boxes to specify whether to Include subfolders (for Compress Action), Overwrite read-only files (for Decompress Action), and/or Remove source files after decompressing or compressing the file.
-
To compress files based on age, select the Compress file(s) older than <n> days check box and provide the number of days (default is 30 days), and next to Specify type of examined file timestamps, specify Created, Modified, or Both (the default is Both).
-
If encryption is desired, select the Encrypt check box and then specify and confirm the password. Select the Show check box to see if you've entered the password correctly.
Also refer to the following properties the ICICompressActionParams interface in the COM API
-
Property AllowOperationForOldFiles As Boolean
-
Property KeepOldFilesInDays As Long
-
Property TimestampTypeForOldFiles as CompressTimestampType
-
Enum CompressTimestampType
In the Backup and Cleanup event rule in EFT:
-
Compress file action is added to the beginning of the event rule
-
Compress files option is enabled with a default value of 90 days
-
Type of examined file timestamps is set to “Both” by default
-
“Cleanup in folder” is in EFT logs
-
Number of days after which the file will be deleted in Cleanup action is only for the Logs folder. The default value is 275 days (previously 30 days)