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: 10.1   10.2   10.3   10.4   10.5   11.0   11.1   11.2   11.3   11.4    Statistic    FMM    Blog  

ZipFile.CreateFile

Creates a new file in the zip archive.

Component Version macOS Windows Linux Server iOS SDK
Compression 3.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes

Deprecated

This function was deprecated. Use Archive.Compress instead.

MBS( "ZipFile.CreateFile"; filename; date { ; Comment; Encoding; zip64 } )   More

Parameters

Parameter Description Example Flags
filename The filename to use. Can include path information with slashes as delimiter. "myfolder/test.txt"
date The file date to use. Get(CurrentTimestamp)
Comment The file comment. "My first file." Optional
Encoding The text encoding for the comment parameter.
Default is UTF-8.
Possible encoding names: ANSI, ISO-8859-1, Latin1, Mac, Native, UTF-8, DOS, Hex, Base64 or Windows. More listed in the FAQ.
UTF8 Optional
zip64 Pass 1 to enable 64-bit zip file.
Default is 0 for 32-bit zip file.
0 Optional

Result

Return OK or error.

Description

Creates a new file in the zip archive.
Use this method before writing data to the file using ZipFile.WriteContainer or ZipFile.WriteTextFile.
Before creating files in archive, you need to open it using ZipFile.Open.
If you want to encrypt file, please use ZipFile.UsePassword before calling this function.

Deprecated. Please use Archive.Compress for new projects.

This function requires a native path. Use Path.FileMakerPathToNativePath to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use FileDialog functions.
For Server be aware that server has limited permissions and may not be able to access all files on a computer.

Examples

Creates a file:

MBS( "ZipFile.CreateFile"; "test.txt"; $date )

See also

Release notes

Example Databases

Blog Entries

FileMaker Magazin

Created 18th August 2014, last changed 12nd June 2020


ZipFile.CompressFiles - ZipFile.Open

Feedback: Report problem or ask question.