ZipFile.UsePassword
-------------------

Sets the password to use for compressing.

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

MBS( "ZipFile.UsePassword"; Password { ; Encoding } ) 

**MBS**( **"ZipFile.UsePassword";** /\* Sets the password to use for compressing. \*/  
**$Password**; /\* The password text.e.g. "pass123" \*/   
**$Encoding**) /\* Optional; The text encoding for Password parameter.   
Default is native.e.g. "native" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Password | The password text. | "pass123" |  |
| Encoding | The text encoding for Password parameter.    Default is native.   Possible encoding names: ANSI, ISO-8859-1, Latin1, Mac, Native, UTF-8, DOS, Hex, Base64 or Windows. More listed in the [FAQ](https://www.monkeybreadsoftware.com/filemaker/faq.shtml). | "native" | Optional |

### Result

Returns OK or error.

### Description

Sets the password to use for compressing.  
The password is needed to create encrypted files in archive.  
Each item in archive could have its own password, but normally all have the same.  
### Examples

Set password:

 MBS ( "ZipFile.UsePassword"; "Hello" )  
### See also

- [UnZipFile.ReadAsFileContainer](UnZipFileReadAsFileContainer.md)
- [UnZipFile.ReadAsGIFContainer](UnZipFileReadAsGIFContainer.md)
- [UnZipFile.ReadAsHex](UnZipFileReadAsHex.md)
- [UnZipFile.ReadAsJPEGContainer](UnZipFileReadAsJPEGContainer.md)
- [UnZipFile.ReadAsPNGContainer](UnZipFileReadAsPNGContainer.md)
- [UnZipFile.ReadAsText](UnZipFileReadAsText.md)
- [UnZipFile.ReadToFile](UnZipFileReadToFile.md)
- [UnZipFile.UsePassword](UnZipFileUsePassword.md)
- [ZipFile.CreateFile](ZipFileCreateFile.md)

### Example Databases

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

### Blog Entries

- [MBS FileMaker Plugin 5.1 for OS X/Windows](https://www.mbsplugins.de/archive/2015-05-19/MBS_FileMaker_Plugin_51_for_OS/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 5.1pr1](https://www.mbsplugins.de/archive/2015-03-16/MBS_FileMaker_Plugin_version_5/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 26th February 2015 , last changed 24th February 2016

  
[ZipFile.SetCompressionLevel](ZipFileSetCompressionLevel.md) - [ZipFile.WriteContainer](ZipFileWriteContainer.md)

[HTML Version](ZipFileUsePassword.shtml)