ZipFile.Open
------------

Creates a new zip archive.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Compression](component_Compression.md) | [3.4](newinversion34.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

### Deprecated

This function was [deprecated](deprecated.md). Use [Archive.Compress](ArchiveCompress.md) instead.

MBS( "ZipFile.Open"; Path { ; Mode } ) 

**MBS**( **"ZipFile.Open";** /\* Creates a new zip archive. \*/  
**$Path**; /\* Native file path. \*/   
**$Mode**) /\* Optional; The appending mode: 0 to create a new archive (default), 1 create on file end, 2 append to existing archive.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Path | Native file path. | $path |  |
| Mode | The appending mode: 0 to create a new archive (default), 1 create on file end, 2 append to existing archive. | 0 | Optional |

### Result

Returns OK or error.

### Description

Creates a new zip archive.  
  
Deprecated due to missing unicode support. Please use [Archive.Compress](ArchiveCompress.md) for new projects.  
  
This function requires a native path. Use [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md) 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](component_FileDialog.md) functions.  
For Server be aware that server has limited permissions and may not be able to access all files on a computer.  
### Examples

Create new archive:

 MBS ( "ZipFile.Open"; "c:\\folder\\test.zip"; 0 )  
### See also

- [Archive.Compress](ArchiveCompress.md)
- [IsError](IsError.md)
- [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md)
- [UnZipFile.ExtractFiles](UnZipFileExtractFiles.md)
- [UnZipFile.OpenFile](UnZipFileOpenFile.md)
- [ZipFile.CreateFile](ZipFileCreateFile.md)

### Release notes

- **Version 14.4**
    - Improved [Archive](https://www.mbsplugins.eu/component_Archive.shtml) functions and [UnZipFile.OpenContainer](https://www.mbsplugins.eu/UnZipFileOpenContainer.shtml) function to better read zip archives downloaded via Insert From URL script step.

### Example Databases

- [Archives/ZipFile](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Archives/ZipFile.shtml#1ScriptAnchor_)

### FileMaker Magazin

- [Ausgabe 5/2013, Seite 21](https://filemaker-magazin.de/neuigkeit/3701-Appetithappen-FMM_201305)

This function checks for a license.

Created 18th August 2014 , last changed 7th February 2023

  
[ZipFile.CreateFile](ZipFileCreateFile.md) - [ZipFile.SetCompressionLevel](ZipFileSetCompressionLevel.md)

[HTML Version](ZipFileOpen.shtml)