Platforms to show: All Mac Windows Linux Cross-Platform
Back to ZipMBS class.
ZipMBS.CompressFiles(ZipFile as FolderItem, SourceFolder as FolderItem, files() as string, Overwrite as Integer = 0, Password as string = "", CompressionLevel as Integer = 9, byref ErrorMessage as string) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Compression | MBS Compression Plugin | 16.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
ZipFile: The destination zip file.
SourceFolder: The source folder for the files.
files: relative file paths to source folder.
Overwrite: pass 1 to overwrite zip archive, 2 to append or 0 to not overwrite.
Password: the password for encryption.
CompressionLevel: The compression level to use from 0 (no compression) to 9 (maximum).
ErrorMessage: An english error message.
Returns 0 on success or error code on failure.
This is a simple function to compress a couple of files.
It does not preserve file permissions on Mac/Linux or other metadata.
And it may not work with non ASCII characters.
If you need more control over files being added, compression or error checking, please use example projects coming with plugin.
Some examples using this method:
The items on this page are in the following plugins: MBS Compression Plugin.