Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.5
10.0
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
Statistic
FMM
Blog
Compresses a few files into a zip archive.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Compression | 6.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
This function was deprecated. Use Archive.Compress instead.
Parameter | Description | Example |
---|---|---|
SourceFolder | The native file path to the source folder for files to compress. | "/Users/cs/Desktop/test" |
ZipFilePath | The native file path to the zip archive. | "/Users/cs/Desktop/test.zip" |
FileList | The list of relative file names to compress. Please only ASCII file names. |
"image1.jpg¶image2.jpg" |
Overwrite | Whether to overwrite the zip archive. Pass 0 to not overwrite an existing file. Pass 1 to overwrite. Pass 2 to apend to a zip file. |
1 |
CompressionLevel | The compress level from 0 (no compression) to 9 (max compression). Default is 9. |
9 |
Returns OK or error.
Compresses some image files:
# first get list of file names in folder:
Set Variable [$list; Value:MBS( "Files.List"; "/Users/cs/Pictures/TestFiles")]
# now compress them:
Set Variable [$r; Value:MBS( "ZipFile.CompressFiles"; "/Users/cs/Pictures/TestFiles"; "/Users/cs/Desktop/test.zip"; $list; 0; 9 )]
Compress some images on Windows:
MBS( "ZipFile.CompressFiles"; "C:\Users\Administrator\Documents"; "C:\Users\Administrator\Desktop\test.zip"; "MBSLogo100.png¶test.png¶other.jpg"; 0; 9 )
Zip a file on Mac:
MBS( "ZipFile.CompressFiles"; "/Users/cs/Desktop"; "/Users/cs/Desktop/Kontakte.zip"; "Kontakte.fmp12"; 1; 9 )
Created 16th January 2016, last changed 12nd June 2020
ZipFile.Close - ZipFile.CreateFile
Feedback: Report problem or ask question.