zip.SetFileCompression -- set file compression
zip.SetFileCompression(id, idx, method[, flags])
This function sets the compression method for the file at index idx in the zip archive specified by id to the compression method specified in method. The optional flags argument can be used to define the compression level, 1 being fastest compression and 9 highest. Allowed values are 1-9 or 0 to use the compressor's default setting.

The method parameter must be one of the following constants:

This is the default setting. Currently the same as #ZIP_CM_DEFLATE.

Store the file uncompressed.

Compress the file using the bzip2 algorithm.

Deflate the file with the zlib algorithm and default options.

Note that only #ZIP_CM_DEFLATE and #ZIP_CM_STORE can be assumed to be universally supported.

Also note that the change to the zip archive isn't done immediately but is postponed until you call zip.CloseArchive().

identifier of the zip archive to use
index of file whose compression should be set
desired compression method (see above)
optional: desired compression level ranging from 1 (fastest) to 9 (highest) or 0 for the compressor's default setting (defaults to 0)

Show TOC