ZipFile.SetCompressionLevel
---------------------------

Sets the compression level.

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

MBS( "ZipFile.SetCompressionLevel"; Method; Level ) 

**MBS**( **"ZipFile.SetCompressionLevel";** /\* Sets the compression level. \*/  
**$Method**; /\* The compression method to use.   
Can be 0 for no compression and 1 for deflate compression.e.g. 1 \*/   
**$Level**) /\* The compression level from 0 (fastest) to 9 (maximum).e.g. 9 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Method | The compression method to use.    Can be 0 for no compression and 1 for deflate compression. | 1 |
| Level | The compression level from 0 (fastest) to 9 (maximum). | 9 |

### Result

Returns OK or error message.

### Description

Sets the compression level.  
By default the plugin uses maximum compression level.  
### Examples

Set default settings:

 MBS ( "ZipFile.SetCompressionLevel"; 1; 9 )  
### See also

- [DynaPDF.GetCompressionLevel](DynaPDFGetCompressionLevel.md)
- [DynaPDF.SetCompressionLevel](DynaPDFSetCompressionLevel.md)

### Release notes

- **Version 8.0**
    - Fixed [ZipFile.SetCompressionLevel](http://www.mbsplugins.eu/ZipFileSetCompressionLevel.shtml) to work with compression better.

### Blog Entries

- [MBS FileMaker Plugin, version 8.0pr9](https://www.mbsplugins.de/archive/2018-01-19/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 29th January 2026

  
[ZipFile.Open](ZipFileOpen.md) - [ZipFile.UsePassword](ZipFileUsePassword.md)

[HTML Version](ZipFileSetCompressionLevel.shtml)