''Zip'' Function

Top  Previous  Next

Zips files or directories.

Syntax

Zip(file-or-directory-namezip-file-name, include-ld-name)

 

Parameters

file-or-directory-name

The name of the file or directory to be zipped.

zip-file-name

The target zip file name.
 
include-ld-name (since version 4.1.5)

This optional boolean parameter with a default value "true" causes that the last directory name is included in the name of the zip entry.
For example c:\aa\bb\cc\readme.txt file is inserted as cc\readme.txt if this parameter is true and as readme.txt otherwise.

 
 

See Absolute or Relative Names.

Note:
If the target zip file already exists it will be overridden.

 

Examples:

@// Zip the files under "/user/user1/work" directory into the file "{WEB_APPLICATION_ROOT}/work.zip"

Zip('/user/user1/work', 'work.zip')

 

@// Zip the files under "c:\documents" directory into the file "c:\docs.zip"

Zip('c:\documents', 'c:\docs.zip')