zip_compress()

Read(4893) Label: zip, compression mode & level,

Description:
Set the compression method and level for files added to the archive later.

Syntax:
zip_compress(
zip,mode,level)

Note:

This ZipCli external library function (See External Library Guide) sets compression method and level for files added to the archive later to get various compression ratio. Affect only newly added files; the compression parameters of existing files in the archive are left unchanged.

Parameter:

zip

A zip file object.

mode 

Compression mode

0: Do not compress

1: Standard compression

2: AES_ENC mode compression

Other values: Standard compression.

 

level

Compression level:

1: DEFLATE_LEVEL_FASTEST

2: DEFLATE_LEVEL_FAST

3: DEFLATE_LEVEL_NORMAL

4: DEFLATE_LEVEL_MAXIMUM

5: DEFLATE_LEVEL_ULTRA

Other values: DEFLATE_LEVEL_NORMAL.

Return value
Boolean

Example:

 

A

 

1

=zip_open("D:/emp.zip")

Open a ZIP archive.

2

=zip_encrypt(A1,1,3)

Standard compression, level 3.

3

=zip_add(A1,"D:/dir1","test.json","pw123")

Append test.json later, using the compression method and level configured above.

4

>zip_close(A1)

Open a ZIP file object.