To create a new ZIP archive, use ZipCreate. It has three, optional, Input Parameters:
As Output Parameters, ZipCreate returns:
Note that after the ZIP archive is created, it is also opened, and ready for adding files to.
There are two ways to open an existing ZIP archive: you can open it directly from disk (by specifying its path), or you can open it from memory (e.g. when a user uploaded it via the browser). Note that opening a ZIP archive hardly uses any memory, as opposed to the standard ZIP Actions from the Platform's ZIP Extension, which loads the entire file in memory.
Use ZipLoadPath if you want to open a ZIP archive that's located someplace the Server can reach it. Note this probably means this can't be a file you have stored locally on your PC! ZipLoadPath has two Input Parameters:
Like ZipCreate, it returns a ZipHandle, but since it doesn't create a new file, there's no FilePathCreated:
Use ZipLoadMemory if you want to open a ZIP archive that's present in memory, for example when the user uploaded it via an upload Screen, or when you retrieved the archive from the database. For further manipulation, it writes the entire file to disk, like ZipCreate, and returns the path of the created file. ZipLoadMemory has three input Parameters:
As Output Parameters, ZipLoadMemory returns:
To retrieve a list of all the files and directories (a.k.a. folders) in a ZIP archive, use ZipFileListGet. It takes a ZipHandle as Input Parameter, and returns a List of entries (files or directories). Note this is meta data only, the actual files are not extracted. The Input Parameter:
Output Parameter:
Note that there is both a LastModified and a ModifiedTime because of historical reasons. See e.g. here for more explanation.
There are two ways to extract a file from a ZIP archive: writing it to disk, and loading it in memory. Note that since extracting a file does not alter the ZIP archive itself, the file is extracted directly (as opposed to adding or deleting a file from a ZIP archive, which is performed when saving the archive.)
Use FileGetPath to extract a file from a ZIP archive, and write it directly to a file on disk. BigZip uses a technique that limits memory use while extracting, so that even very large files will be extracted without memory use increasing much. This as opposed to the standard ZIP Actions from the Platform's ZIP Extension, which loads the entire file in memory before you can save it, like FileGetMemory does. FileGetPath has the following Input Parameters:
Use FileGetMemory if you want to extract a file from a ZIP archive and keep it in memory, e.g. to allow the user to download it. It has the following Input Parameters:
There are two ways to add a file to a ZIP archive: from disk, and from memory. As with ZIP archives themselves, if you want to add a file from disk, it needs to be accessible by the Server, so files stored on the user's local hard disk can only be added after uploading them in the browser. Note that the Actions will only collect meta data, and the file won't actually be added to the ZIP archive until it is saved.
Use FileAddPath if you have a file stored on disk, and you want to add it to the ZIP archive. You need a ZipHandle from one of the Actions to create or open a ZIP archive, and the path to the file to add. Optionally you can also specify the name the file has to have inside the archive, if it must be different than the name on disk. Input Parameters:
FileAddPath has no output parameters.
Use FileAddMemory if you have a file in memory, e.g. because a user uploaded it or it's stored in the database, and you want to add it to the ZIP archive. Input parameters:
FileAddMemory has no output parameters.
There are two ways to replace the content of a file inside a ZIP archive: from disk, and from memory. As with ZIP archives themselves, if you want to add a file from disk, it needs to be accessible by the Server, so files stored on the user's local hard disk can only be added after uploading them in the browser. Note that the Actions will only collect meta data, and the file won't actually be replaced until the ZIP archive is saved.
Use FileReplacePath if you have a file stored on disk, and you want to add it to the ZIP archive replacing an existing file. You need a ZipHandle from one of the Actions to create or open a ZIP archive, and the path to the file to add. Input Parameters:
FileReplacePath has no output parameters.
Use FileReplaceMemory if you have a file in memory, e.g. because a user uploaded it or it's stored in the database, and you want to add it to the ZIP archive replacing an existing file. Input parameters:
FileReplaceMemory has no output parameters.
To remove (a.k.a. delete) a file from a ZIP archive, use FileDelete. Note the file won't actually be removed from the ZIP archive until the archive is saved.
FileDelete removes a file from the ZIP archive. Input Parameters:
FileDelete has no output parameters.
To apply all changes to a ZIP archive, i.e. apply all FileAdd*, FileReplace* and FileDelete Actions, use ZipSave. When calling ZipSave, all added and replaced files will be compressed and added to the ZIP archive on disk, and all deleted files will removed from the archive. After saving, it is still possible to add, replace and delete files, but those changes will not be made until the next ZipSave.
Updates the ZIP archive, applying all changes made to it. Files added will be compressed and added, files replaced will be deleted and replaced by new files, which are compressed before they are added, and deleted files are deleted. Input Parameter:
Normally, the ZIP archive will unload itself from memory automatically. However, if you handle multiple ZIP archives within a single Action, you may want to unload a ZIP archive explicitly, to free up memory for subsequent calls to BigZip (note that in general, memory usage should not be a problem, as BigZip uses little memory to begin with). To do so, use ZipUnload.
Unloads the ZIP file from memory. Note that any files retrieved with FileGetMemory are not unloaded. Also note that after calling ZipLoad, the ZipHandle is no longer valid. Using it will lead to unpredictable results (most likely an Exception). Input Parameter:
Compression level, password and encryption algorithm can be set per file in a ZIP archive. To do so, change any of these properties before adding a file to the ZIP archive, and any subsequent addition will use the properties as set.
Sets the compression level. Input parameters:
Sets the password for encrypted files or removes the password for normal storage. Input parameters:
Sets the encryption algorithm used for password protected files. Input parameters: