---
product: Chilkat
product_version: 11.7.0
language: c
language_label: C
class: Zip
license: bundle
deprecated: false
reference_html: https://www.chilkatsoft.com/refdoc/c_CkZipRef.html
---
# Chilkat Zip — C — v11.7.0

> Chilkat 11.7.0 · language=c · class=Zip
> Other versions: replace `11.7.0` in this URL. Other languages: `https://www.chilkatsoft.com/ai-docs/v/11.7.0/<lang>/classes/Zip.md`.
> Language-wide rules (install, unlock, error model, strings/bytes): `https://www.chilkatsoft.com/ai-docs/v/11.7.0/c/guide.md`.

## Purpose

**Create, read, modify, encrypt, and extract ZIP archives.**

`Chilkat.Zip` provides a comprehensive API for working with ZIP archives from files, memory, `BinData`, embedded resources, and Windows self-extracting EXEs. It can create new archives, open existing ZIPs, add files or in-memory data, inspect entries, extract selectively, and write the final archive to disk or memory.

**Create ZIP archives**

Add files, directories, strings, byte arrays, `BinData`, and `StringBuilder` content.

**Open ZIPs from many sources**

Open archives from disk, memory, `BinData`, embedded Windows resources, or Chilkat-created self-extracting EXEs.

**Control stored paths**

Use options such as `AppendFromDir`, `DiscardPaths`, `PathPrefix`, and `saveExtraPath`.

**Extract selectively**

Extract all files, matching entries, newer files, or flatten all output into a single directory.

**Encryption support**

Work with WinZip-compatible AES encryption and legacy Zip 2.0 password protection.

**Large archive support**

ZIP64 is used automatically when older ZIP limits are exceeded.

**Important:** Many methods update the in-memory ZIP object first. The archive is not written until a method such as `WriteZip`, `WriteZipAndClose`, `WriteBd`, or `WriteToMemory` is called.

For an extended overview, see [Zip Class Overview](https://www.chilkatsoft.com/zip_class_overview.asp).

## Object creation, unlocking and error handling

**Create/Dispose**

```c
HCkZip instance = CkZip_Create();
// ...
CkZip_Dispose(instance);
```

`HCkZip CkZip_Create(void);`

Creates an instance of the HCkZip object and returns a handle ("void \*" pointer). The handle is passed in the 1st argument for the functions listed on this page.

`void CkZip_Dispose(HCkZip handle);`

Objects created by calling CkZip_Create must be freed by calling this method. A memory leak occurs if a handle is not disposed by calling this function. Also, any handle returned by a Chilkat "C" function must also be freed by the application by calling the appropriate Dispose method, such as CkZip_Dispose.

Call `Global.UnlockBundle` once at the start of the program, before using this or any other Chilkat class. Any string unlocks a fully functional 30-day trial; a purchased unlock code is used in production. See `guide.md` for the exact code in C.

## Members common to every Chilkat class

Documented once per language in `common-members.md`; listed here so this page is self-contained.

| Property | Signature | Access | Meaning |
|---|---|---|---|
| `DebugLogFilePath` | `void CkZip_getDebugLogFilePath(HCkZip cHandle, HCkString retval); void CkZip_putDebugLogFilePath(HCkZip cHandle, const char *newVal); const char *CkZip_debugLogFilePath(HCkZip cHandle);` | read/write | If set to a file path, this property logs the LastErrorText of each Chilkat method or property call to the specified file. |
| `LastErrorHtml` | `void CkZip_getLastErrorHtml(HCkZip cHandle, HCkString retval); const char *CkZip_lastErrorHtml(HCkZip cHandle);` | read-only | Provides HTML-formatted information about the last called method or property. |
| `LastErrorText` | `void CkZip_getLastErrorText(HCkZip cHandle, HCkString retval); const char *CkZip_lastErrorText(HCkZip cHandle);` | read-only | Provides plain text information about the last called method or property. |
| `LastErrorXml` | `void CkZip_getLastErrorXml(HCkZip cHandle, HCkString retval); const char *CkZip_lastErrorXml(HCkZip cHandle);` | read-only | Provides XML-formatted information about the last called method or property. |
| `LastMethodSuccess` | `BOOL CkZip_getLastMethodSuccess(HCkZip cHandle); void CkZip_putLastMethodSuccess(HCkZip cHandle, BOOL newVal);` | read/write | Indicates the success or failure of the most recent method call: `TRUE` means success, `FALSE` means failure. |
| `Utf8` | `BOOL CkZip_getUtf8(HCkZip cHandle); void CkZip_putUtf8(HCkZip cHandle, BOOL newVal);` | read/write | When set to `TRUE`, all `const char *` arguments and return values are interpreted as UTF-8 strings. |
| `VerboseLogging` | `BOOL CkZip_getVerboseLogging(HCkZip cHandle); void CkZip_putVerboseLogging(HCkZip cHandle, BOOL newVal);` | read/write | If set to `TRUE`, then the contents of LastErrorText (or LastErrorXml, or LastErrorHtml) may contain more verbose information. |
| `Version` | `void CkZip_getVersion(HCkZip cHandle, HCkString retval); const char *CkZip_version(HCkZip cHandle);` | read-only | Version of the component/library, such as "10.1.0" |

## Member index

| Member | Kind | Signature |
|---|---|---|
| `AbortCurrent` | property, read/write | `BOOL CkZip_getAbortCurrent(HCkZip cHandle); void CkZip_putAbortCurrent(HCkZip cHandle, BOOL newVal);` |
| `AppendFromDir` | property, read/write | `void CkZip_getAppendFromDir(HCkZip cHandle, HCkString retval); void CkZip_putAppendFromDir(HCkZip cHandle, const char *newVal); const char *CkZip_appendFromDir(HCkZip cHandle);` |
| `AutoRun` | property, read/write | `void CkZip_getAutoRun(HCkZip cHandle, HCkString retval); void CkZip_putAutoRun(HCkZip cHandle, const char *newVal); const char *CkZip_autoRun(HCkZip cHandle);` |
| `AutoRunParams` | property, read/write | `void CkZip_getAutoRunParams(HCkZip cHandle, HCkString retval); void CkZip_putAutoRunParams(HCkZip cHandle, const char *newVal); const char *CkZip_autoRunParams(HCkZip cHandle);` |
| `AutoTemp` | property, read/write | `BOOL CkZip_getAutoTemp(HCkZip cHandle); void CkZip_putAutoTemp(HCkZip cHandle, BOOL newVal);` |
| `CaseSensitive` | property, read/write | `BOOL CkZip_getCaseSensitive(HCkZip cHandle); void CkZip_putCaseSensitive(HCkZip cHandle, BOOL newVal);` |
| `ClearArchiveAttribute` | property, read/write | `BOOL CkZip_getClearArchiveAttribute(HCkZip cHandle); void CkZip_putClearArchiveAttribute(HCkZip cHandle, BOOL newVal);` |
| `ClearReadOnlyAttr` | property, read/write | `BOOL CkZip_getClearReadOnlyAttr(HCkZip cHandle); void CkZip_putClearReadOnlyAttr(HCkZip cHandle, BOOL newVal);` |
| `Comment` | property, read/write | `void CkZip_getComment(HCkZip cHandle, HCkString retval); void CkZip_putComment(HCkZip cHandle, const char *newVal); const char *CkZip_comment(HCkZip cHandle);` |
| `DecryptPassword` | property, read/write | `void CkZip_getDecryptPassword(HCkZip cHandle, HCkString retval); void CkZip_putDecryptPassword(HCkZip cHandle, const char *newVal); const char *CkZip_decryptPassword(HCkZip cHandle);` |
| `DiscardPaths` | property, read/write | `BOOL CkZip_getDiscardPaths(HCkZip cHandle); void CkZip_putDiscardPaths(HCkZip cHandle, BOOL newVal);` |
| `Encryption` | property, read/write | `int CkZip_getEncryption(HCkZip cHandle); void CkZip_putEncryption(HCkZip cHandle, int newVal);` |
| `EncryptKeyLength` | property, read/write | `int CkZip_getEncryptKeyLength(HCkZip cHandle); void CkZip_putEncryptKeyLength(HCkZip cHandle, int newVal);` |
| `EncryptPassword` | property, read/write | `void CkZip_getEncryptPassword(HCkZip cHandle, HCkString retval); void CkZip_putEncryptPassword(HCkZip cHandle, const char *newVal); const char *CkZip_encryptPassword(HCkZip cHandle);` |
| `ExeDefaultDir` | property, read/write | `void CkZip_getExeDefaultDir(HCkZip cHandle, HCkString retval); void CkZip_putExeDefaultDir(HCkZip cHandle, const char *newVal); const char *CkZip_exeDefaultDir(HCkZip cHandle);` |
| `ExeFinishNotifier` | property, read/write | `BOOL CkZip_getExeFinishNotifier(HCkZip cHandle); void CkZip_putExeFinishNotifier(HCkZip cHandle, BOOL newVal);` |
| `ExeIconFile` | property, read/write | `void CkZip_getExeIconFile(HCkZip cHandle, HCkString retval); void CkZip_putExeIconFile(HCkZip cHandle, const char *newVal); const char *CkZip_exeIconFile(HCkZip cHandle);` |
| `ExeNoInterface` | property, read/write | `BOOL CkZip_getExeNoInterface(HCkZip cHandle); void CkZip_putExeNoInterface(HCkZip cHandle, BOOL newVal);` |
| `ExeSilentProgress` | property, read/write | `BOOL CkZip_getExeSilentProgress(HCkZip cHandle); void CkZip_putExeSilentProgress(HCkZip cHandle, BOOL newVal);` |
| `ExeTitle` | property, read/write | `void CkZip_getExeTitle(HCkZip cHandle, HCkString retval); void CkZip_putExeTitle(HCkZip cHandle, const char *newVal); const char *CkZip_exeTitle(HCkZip cHandle);` |
| `ExeUnzipCaption` | property, read/write | `void CkZip_getExeUnzipCaption(HCkZip cHandle, HCkString retval); void CkZip_putExeUnzipCaption(HCkZip cHandle, const char *newVal); const char *CkZip_exeUnzipCaption(HCkZip cHandle);` |
| `ExeUnzipDir` | property, read/write | `void CkZip_getExeUnzipDir(HCkZip cHandle, HCkString retval); void CkZip_putExeUnzipDir(HCkZip cHandle, const char *newVal); const char *CkZip_exeUnzipDir(HCkZip cHandle);` |
| `ExeWaitForSetup` | property, read/write | `BOOL CkZip_getExeWaitForSetup(HCkZip cHandle); void CkZip_putExeWaitForSetup(HCkZip cHandle, BOOL newVal);` |
| `ExeXmlConfig` | property, read/write | `void CkZip_getExeXmlConfig(HCkZip cHandle, HCkString retval); void CkZip_putExeXmlConfig(HCkZip cHandle, const char *newVal); const char *CkZip_exeXmlConfig(HCkZip cHandle);` |
| `FileCount` | property, read-only | `int CkZip_getFileCount(HCkZip cHandle);` |
| `FileName` | property, read/write | `void CkZip_getFileName(HCkZip cHandle, HCkString retval); void CkZip_putFileName(HCkZip cHandle, const char *newVal); const char *CkZip_fileName(HCkZip cHandle);` |
| `HasZipFormatErrors` | property, read-only | `BOOL CkZip_getHasZipFormatErrors(HCkZip cHandle);` |
| `HeartbeatMs` | property, read/write | `int CkZip_getHeartbeatMs(HCkZip cHandle); void CkZip_putHeartbeatMs(HCkZip cHandle, int newVal);` |
| `IgnoreAccessDenied` | property, read/write | `BOOL CkZip_getIgnoreAccessDenied(HCkZip cHandle); void CkZip_putIgnoreAccessDenied(HCkZip cHandle, BOOL newVal);` |
| `MaxDate` | property, read/write | `void CkZip_getMaxDate(HCkZip cHandle, HCkString retval); void CkZip_putMaxDate(HCkZip cHandle, const char *newVal); const char *CkZip_maxDate(HCkZip cHandle);` |
| `MaxUncompressSize` | property, read/write | `unsigned long CkZip_getMaxUncompressSize(HCkZip cHandle); void CkZip_putMaxUncompressSize(HCkZip cHandle, unsigned long newVal);` |
| `MinDate` | property, read/write | `void CkZip_getMinDate(HCkZip cHandle, HCkString retval); void CkZip_putMinDate(HCkZip cHandle, const char *newVal); const char *CkZip_minDate(HCkZip cHandle);` |
| `NumEntries` | property, read-only | `int CkZip_getNumEntries(HCkZip cHandle);` |
| `OemCodePage` | property, read/write | `int CkZip_getOemCodePage(HCkZip cHandle); void CkZip_putOemCodePage(HCkZip cHandle, int newVal);` |
| `OverwriteExisting` | property, read/write | `BOOL CkZip_getOverwriteExisting(HCkZip cHandle); void CkZip_putOverwriteExisting(HCkZip cHandle, BOOL newVal);` |
| `PasswordProtect` | property, read/write | `BOOL CkZip_getPasswordProtect(HCkZip cHandle); void CkZip_putPasswordProtect(HCkZip cHandle, BOOL newVal);` |
| `PathPrefix` | property, read/write | `void CkZip_getPathPrefix(HCkZip cHandle, HCkString retval); void CkZip_putPathPrefix(HCkZip cHandle, const char *newVal); const char *CkZip_pathPrefix(HCkZip cHandle);` |
| `PercentDoneScale` | property, read/write | `int CkZip_getPercentDoneScale(HCkZip cHandle); void CkZip_putPercentDoneScale(HCkZip cHandle, int newVal);` |
| `PwdProtCharset` | property, read/write | `void CkZip_getPwdProtCharset(HCkZip cHandle, HCkString retval); void CkZip_putPwdProtCharset(HCkZip cHandle, const char *newVal); const char *CkZip_pwdProtCharset(HCkZip cHandle);` |
| `TempDir` | property, read/write | `void CkZip_getTempDir(HCkZip cHandle, HCkString retval); void CkZip_putTempDir(HCkZip cHandle, const char *newVal); const char *CkZip_tempDir(HCkZip cHandle);` |
| `UncommonOptions` | property, read/write | `void CkZip_getUncommonOptions(HCkZip cHandle, HCkString retval); void CkZip_putUncommonOptions(HCkZip cHandle, const char *newVal); const char *CkZip_uncommonOptions(HCkZip cHandle);` |
| `Zipx` | property, read/write | `BOOL CkZip_getZipx(HCkZip cHandle); void CkZip_putZipx(HCkZip cHandle, BOOL newVal);` |
| `ZipxDefaultAlg` | property, read/write | `void CkZip_getZipxDefaultAlg(HCkZip cHandle, HCkString retval); void CkZip_putZipxDefaultAlg(HCkZip cHandle, const char *newVal); const char *CkZip_zipxDefaultAlg(HCkZip cHandle);` |
| `AddBd` | method | `BOOL CkZip_AddBd(HCkZip cHandle, const char *pathInZip, HCkBinData bd);` |
| `AddEmpty` | method | `BOOL CkZip_AddEmpty(HCkZip cHandle, BOOL isDir, const char *pathInZip);` |
| `AddEncoded` | method | `BOOL CkZip_AddEncoded(HCkZip cHandle, const char *pathInZip, const char *encoding, const char *data);` |
| `AddFile` | method | `BOOL CkZip_AddFile(HCkZip cHandle, const char *localPath, BOOL saveExtraPath);` |
| `AddNoCompressExtension` | method | `void CkZip_AddNoCompressExtension(HCkZip cHandle, const char *fileExtension);` |
| `AddSb` | method | `BOOL CkZip_AddSb(HCkZip cHandle, const char *pathInZip, HCkStringBuilder sb, const char *charset);` |
| `AddString` | method | `BOOL CkZip_AddString(HCkZip cHandle, const char *pathInZip, const char *content, const char *charset);` |
| `AppendFiles` | method | `BOOL CkZip_AppendFiles(HCkZip cHandle, const char *filePattern, BOOL recurse);` |
| `AppendFilesEx` | method | `BOOL CkZip_AppendFilesEx(HCkZip cHandle, const char *filePattern, BOOL recurse, BOOL saveExtraPath, BOOL archiveOnly, BOOL includeHidden, BOOL includeSystem);` |
| `AppendZip` | method | `BOOL CkZip_AppendZip(HCkZip cHandle, const char *zipPath);` |
| `CloseZip` | method | `void CkZip_CloseZip(HCkZip cHandle);` |
| `DeleteEntry` | method | `BOOL CkZip_DeleteEntry(HCkZip cHandle, HCkZipEntry entry);` |
| `EntryAt` | method | `BOOL CkZip_EntryAt(HCkZip cHandle, int index, HCkZipEntry entry);` |
| `EntryById` | method | `BOOL CkZip_EntryById(HCkZip cHandle, int id, HCkZipEntry entry);` |
| `EntryMatching` | method | `BOOL CkZip_EntryMatching(HCkZip cHandle, const char *pattern, HCkZipEntry entry);` |
| `EntryOf` | method | `BOOL CkZip_EntryOf(HCkZip cHandle, const char *pathInZip, HCkZipEntry entry);` |
| `ExcludeDir` | method | `void CkZip_ExcludeDir(HCkZip cHandle, const char *dirName);` |
| `ExtractExe` | method | `BOOL CkZip_ExtractExe(HCkZip cHandle, const char *exePath, const char *dirPath);` |
| `GetDirectoryAsXML` | method | `BOOL CkZip_GetDirectoryAsXML(HCkZip cHandle, HCkString outXml); const char *CkZip_getDirectoryAsXML(HCkZip cHandle);` |
| `GetExeConfigParam` | method | `BOOL CkZip_GetExeConfigParam(HCkZip cHandle, const char *name, HCkString outStr); const char *CkZip_getExeConfigParam(HCkZip cHandle, const char *name);` |
| `GetMaxUncompressedSize` | method | `BOOL CkZip_GetMaxUncompressedSize(HCkZip cHandle, HCkString outStr); const char *CkZip_getMaxUncompressedSize(HCkZip cHandle);` |
| `IsNoCompressExtension` | method | `BOOL CkZip_IsNoCompressExtension(HCkZip cHandle, const char *fileExtension);` |
| `IsPasswordProtected` | method | `BOOL CkZip_IsPasswordProtected(HCkZip cHandle, const char *zipPath);` |
| `LoadTaskCaller` | method | `BOOL CkZip_LoadTaskCaller(HCkZip cHandle, HCkTask task);` |
| `NewZip` | method | `BOOL CkZip_NewZip(HCkZip cHandle, const char *zipPath);` |
| `OpenBd` | method | `BOOL CkZip_OpenBd(HCkZip cHandle, HCkBinData binData);` |
| `OpenEmbedded` | method | `BOOL CkZip_OpenEmbedded(HCkZip cHandle, const char *exeFilename, const char *resourceName);` |
| `OpenZip` | method | `BOOL CkZip_OpenZip(HCkZip cHandle, const char *zipPath);` |
| `QuickAppend` | method | `BOOL CkZip_QuickAppend(HCkZip cHandle, const char *zipPath);` |
| `RemoveNoCompressExtension` | method | `void CkZip_RemoveNoCompressExtension(HCkZip cHandle, const char *fileExtension);` |
| `SetCompressionLevel` | method | `void CkZip_SetCompressionLevel(HCkZip cHandle, int level);` |
| `SetExclusions` | method | `void CkZip_SetExclusions(HCkZip cHandle, HCkStringArray excludePatterns);` |
| `SetExeConfigParam` | method | `void CkZip_SetExeConfigParam(HCkZip cHandle, const char *paramName, const char *paramValue);` |
| `Unzip` | method | `int CkZip_Unzip(HCkZip cHandle, const char *dirPath);` |
| `UnzipInto` | method | `int CkZip_UnzipInto(HCkZip cHandle, const char *dirPath);` |
| `UnzipMatching` | method | `int CkZip_UnzipMatching(HCkZip cHandle, const char *dirPath, const char *pattern, BOOL verbose);` |
| `UnzipMatchingInto` | method | `int CkZip_UnzipMatchingInto(HCkZip cHandle, const char *dirPath, const char *pattern, BOOL verbose);` |
| `UnzipNewer` | method | `int CkZip_UnzipNewer(HCkZip cHandle, const char *dirPath);` |
| `VerifyPassword` | method | `BOOL CkZip_VerifyPassword(HCkZip cHandle);` |
| `WriteBd` | method | `BOOL CkZip_WriteBd(HCkZip cHandle, HCkBinData binData);` |
| `WriteExe` | method | `BOOL CkZip_WriteExe(HCkZip cHandle, const char *exeFilename);` |
| `WriteZip` | method | `BOOL CkZip_WriteZip(HCkZip cHandle);` |
| `WriteZipAndClose` | method | `BOOL CkZip_WriteZipAndClose(HCkZip cHandle);` |

Deprecated members are listed at the end of this file with their replacements; do not use them in new code.

## Properties

### Zip.AbortCurrent

`Chilkat 11.7.0 · c · Zip · AbortCurrent · property · read/write · since 9.5.0.58`

```c
BOOL CkZip_getAbortCurrent(HCkZip cHandle);
void CkZip_putAbortCurrent(HCkZip cHandle, BOOL newVal);
```

Stops the currently executing operation when set to `TRUE`.

- Used to cancel long-running operations such as compression or extraction.
- Can be triggered from another thread.
- Automatically resets to `FALSE` after the operation stops.

### Zip.AppendFromDir

`Chilkat 11.7.0 · c · Zip · AppendFromDir · property · read/write`

```c
void CkZip_getAppendFromDir(HCkZip cHandle, HCkString retval);
void CkZip_putAppendFromDir(HCkZip cHandle, const char *newVal);
const char *CkZip_appendFromDir(HCkZip cHandle);
```

Specifies a base directory when adding files to the ZIP.

- This portion of the path is **not included** in stored ZIP entry paths.
- Useful for controlling relative paths inside the archive.

For example, to add all files under `c:/abc/123/myAppDir`, this property could be set to `c:/abc/123`, and `myAppDir/*` would be passed to `AppendFiles`.

The path stored in the ZIP would begin with `myAppDir/`.

### Zip.AutoRun

`Chilkat 11.7.0 · c · Zip · AutoRun · property · read/write`

```c
void CkZip_getAutoRun(HCkZip cHandle, HCkString retval);
void CkZip_putAutoRun(HCkZip cHandle, const char *newVal);
const char *CkZip_autoRun(HCkZip cHandle);
```

`(Windows only, for creating self-extracting EXE's)`

Specifies the name of an executable inside a self-extracting EXE that runs automatically after extraction.

### Zip.AutoRunParams

`Chilkat 11.7.0 · c · Zip · AutoRunParams · property · read/write`

```c
void CkZip_getAutoRunParams(HCkZip cHandle, HCkString retval);
void CkZip_putAutoRunParams(HCkZip cHandle, const char *newVal);
const char *CkZip_autoRunParams(HCkZip cHandle);
```

`(Windows only, for creating self-extracting EXE's)`

Command-line arguments passed to the `AutoRun` executable.

### Zip.AutoTemp

`Chilkat 11.7.0 · c · Zip · AutoTemp · property · read/write`

```c
BOOL CkZip_getAutoTemp(HCkZip cHandle);
void CkZip_putAutoTemp(HCkZip cHandle, BOOL newVal);
```

`(Windows only, for creating self-extracting EXE's)`

If `TRUE`, the EXE being created will automatically select and create a temporary directory for unzipping.

This property is often used together with `AutoRun` to create a self-extracting EXE that automatically unzips to a temporary directory and runs a setup program, such as `setup.exe`, without user interaction.

**Note:** To create a self-extracting EXE with no user interaction, set the following properties:

> `ExeSilentProgress = FALSE`  
> `ExeNoInterface = TRUE`  
> `ExeFinishNotifier = FALSE`

The default value is `FALSE`.

### Zip.CaseSensitive

`Chilkat 11.7.0 · c · Zip · CaseSensitive · property · read/write`

```c
BOOL CkZip_getCaseSensitive(HCkZip cHandle);
void CkZip_putCaseSensitive(HCkZip cHandle, BOOL newVal);
```

Controls whether filename matching is case-sensitive.

- Affects methods such as `EntryMatching` and `UnzipMatching`.
- Default: `FALSE`

### Zip.ClearArchiveAttribute

`Chilkat 11.7.0 · c · Zip · ClearArchiveAttribute · property · read/write`

```c
BOOL CkZip_getClearArchiveAttribute(HCkZip cHandle);
void CkZip_putClearArchiveAttribute(HCkZip cHandle, BOOL newVal);
```

`(Windows only)`

If `TRUE`, clears the Windows archive attribute after files are successfully added to the ZIP.

The archive attribute indicates that a file has changed since the last backup.

The default value is `FALSE`.

### Zip.ClearReadOnlyAttr

`Chilkat 11.7.0 · c · Zip · ClearReadOnlyAttr · property · read/write`

```c
BOOL CkZip_getClearReadOnlyAttr(HCkZip cHandle);
void CkZip_putClearReadOnlyAttr(HCkZip cHandle, BOOL newVal);
```

If `TRUE`, removes the read-only attribute from extracted files.

If `FALSE`, the read-only attribute remains unchanged.

The default value is `FALSE`.

### Zip.Comment

`Chilkat 11.7.0 · c · Zip · Comment · property · read/write`

```c
void CkZip_getComment(HCkZip cHandle, HCkString retval);
void CkZip_putComment(HCkZip cHandle, const char *newVal);
const char *CkZip_comment(HCkZip cHandle);
```

Sets or retrieves the global ZIP file comment.

The default value is the empty string.

### Zip.DecryptPassword

`Chilkat 11.7.0 · c · Zip · DecryptPassword · property · read/write`

```c
void CkZip_getDecryptPassword(HCkZip cHandle, HCkString retval);
void CkZip_putDecryptPassword(HCkZip cHandle, const char *newVal);
const char *CkZip_decryptPassword(HCkZip cHandle);
```

Password used to extract encrypted ZIP archives.

- Required to unzip encrypted entries.
- Encrypted ZIP files may still be opened without a password, but their contents cannot be extracted until the correct password is provided.

The default value is the empty string.

### Zip.DiscardPaths

`Chilkat 11.7.0 · c · Zip · DiscardPaths · property · read/write`

```c
BOOL CkZip_getDiscardPaths(HCkZip cHandle);
void CkZip_putDiscardPaths(HCkZip cHandle, BOOL newVal);
```

If `TRUE`, removes all directory path information when adding files.

Only filenames are stored in the ZIP.

The default value is `FALSE`.

### Zip.Encryption

`Chilkat 11.7.0 · c · Zip · Encryption · property · read/write`

```c
int CkZip_getEncryption(HCkZip cHandle);
void CkZip_putEncryption(HCkZip cHandle, int newVal);
```

Specifies encryption mode:

- `0` → No encryption
- `4` → WinZip-compatible AES encryption

**Important:** `Encryption` and `PasswordProtect` are mutually exclusive.

If `PasswordProtect = TRUE`, then `Encryption` should be `0`.

The default value is `0`.

### Zip.EncryptKeyLength

`Chilkat 11.7.0 · c · Zip · EncryptKeyLength · property · read/write`

```c
int CkZip_getEncryptKeyLength(HCkZip cHandle);
void CkZip_putEncryptKeyLength(HCkZip cHandle, int newVal);
```

Specifies the AES encryption key length.

- Valid values: `128`, `192`, or `256`

The default value is `128`.

### Zip.EncryptPassword

`Chilkat 11.7.0 · c · Zip · EncryptPassword · property · read/write`

```c
void CkZip_getEncryptPassword(HCkZip cHandle, HCkString retval);
void CkZip_putEncryptPassword(HCkZip cHandle, const char *newVal);
const char *CkZip_encryptPassword(HCkZip cHandle);
```

Password used when creating encrypted ZIP archives.

The default value is the empty string.

### Zip.ExeDefaultDir

`Chilkat 11.7.0 · c · Zip · ExeDefaultDir · property · read/write`

```c
void CkZip_getExeDefaultDir(HCkZip cHandle, HCkString retval);
void CkZip_putExeDefaultDir(HCkZip cHandle, const char *newVal);
const char *CkZip_exeDefaultDir(HCkZip cHandle);
```

`(Windows only, for creating self-extracting EXE's)`

Default extraction directory shown in the self-extracting EXE user interface.

The default value is the empty string.

### Zip.ExeFinishNotifier

`Chilkat 11.7.0 · c · Zip · ExeFinishNotifier · property · read/write`

```c
BOOL CkZip_getExeFinishNotifier(HCkZip cHandle);
void CkZip_putExeFinishNotifier(HCkZip cHandle, BOOL newVal);
```

`(Windows only, for creating self-extracting EXE's)`

If `TRUE`, displays a completion dialog after extraction finishes.

The default value is `FALSE`.

### Zip.ExeIconFile

`Chilkat 11.7.0 · c · Zip · ExeIconFile · property · read/write`

```c
void CkZip_getExeIconFile(HCkZip cHandle, HCkString retval);
void CkZip_putExeIconFile(HCkZip cHandle, const char *newVal);
const char *CkZip_exeIconFile(HCkZip cHandle);
```

`(Windows only, for creating self-extracting EXE's)`

Path to an `.ico` file used as the EXE icon.

This feature is only available when the application creating the EXE is 32-bit.

The default value is the empty string.

### Zip.ExeNoInterface

`Chilkat 11.7.0 · c · Zip · ExeNoInterface · property · read/write`

```c
BOOL CkZip_getExeNoInterface(HCkZip cHandle);
void CkZip_putExeNoInterface(HCkZip cHandle, BOOL newVal);
```

`(Windows only, for creating self-extracting EXE's)`

If `TRUE`, runs the self-extracting EXE without displaying the main user interface.

The default value is `FALSE`.

### Zip.ExeSilentProgress

`Chilkat 11.7.0 · c · Zip · ExeSilentProgress · property · read/write`

```c
BOOL CkZip_getExeSilentProgress(HCkZip cHandle);
void CkZip_putExeSilentProgress(HCkZip cHandle, BOOL newVal);
```

`(Windows only, for creating self-extracting EXE's)`

Controls whether a progress dialog is shown during extraction.

If `ExeNoInterface = FALSE`, the progress bar appears within the main dialog and this property has no effect.

The default value is `FALSE`.

### Zip.ExeTitle

`Chilkat 11.7.0 · c · Zip · ExeTitle · property · read/write`

```c
void CkZip_getExeTitle(HCkZip cHandle, HCkString retval);
void CkZip_putExeTitle(HCkZip cHandle, const char *newVal);
const char *CkZip_exeTitle(HCkZip cHandle);
```

`(Windows only, for creating self-extracting EXE's)`

Title displayed in the self-extracting EXE dialog.

The default value is the empty string.

### Zip.ExeUnzipCaption

`Chilkat 11.7.0 · c · Zip · ExeUnzipCaption · property · read/write`

```c
void CkZip_getExeUnzipCaption(HCkZip cHandle, HCkString retval);
void CkZip_putExeUnzipCaption(HCkZip cHandle, const char *newVal);
const char *CkZip_exeUnzipCaption(HCkZip cHandle);
```

`(Windows only, for creating self-extracting EXE's)`

Caption text displayed in the self-extracting EXE dialog.

The default value is the empty string.

### Zip.ExeUnzipDir

`Chilkat 11.7.0 · c · Zip · ExeUnzipDir · property · read/write`

```c
void CkZip_getExeUnzipDir(HCkZip cHandle, HCkString retval);
void CkZip_putExeUnzipDir(HCkZip cHandle, const char *newVal);
const char *CkZip_exeUnzipDir(HCkZip cHandle);
```

`(Windows only, for creating self-extracting EXE's)`

Specifies a predefined extraction directory.

- Supports environment variables such as `%TEMP%`.
- UNC paths are not supported.

The default value is the empty string.

### Zip.ExeWaitForSetup

`Chilkat 11.7.0 · c · Zip · ExeWaitForSetup · property · read/write`

```c
BOOL CkZip_getExeWaitForSetup(HCkZip cHandle);
void CkZip_putExeWaitForSetup(HCkZip cHandle, BOOL newVal);
```

If `TRUE`, waits for the AutoRun executable to finish before exiting.

If `FALSE`, the self-extracting EXE may exit before the AutoRun executable completes.

The default value is `TRUE`.

### Zip.ExeXmlConfig

`Chilkat 11.7.0 · c · Zip · ExeXmlConfig · property · read/write`

```c
void CkZip_getExeXmlConfig(HCkZip cHandle, HCkString retval);
void CkZip_putExeXmlConfig(HCkZip cHandle, const char *newVal);
const char *CkZip_exeXmlConfig(HCkZip cHandle);
```

Allows for an XML config document to be used to specify all possible options for self-extracting EXEs. This property is a string containing the XML config document.

The XML should have this format:

\<SfxConfig>

\<ErrPwdTitle>Title for incorrect password dialog\</ErrPwdTitle>

\<ErrPwdCaption>Caption for incorrect password dialog\</ErrPwdCaption>

\<FinOkBtn>Text on finish notifier button\</FinOkBtn>

\<PwdOkBtn>Text on password challenge dialog's "OK" button.\</PwdOkBtn>

\<PwdCancelBtn>Text on password challenge dialog's Cancel button.\</PwdCancelBtn>

\<ErrInvalidPassword>Incorrect password error message.\</ErrInvalidPassword>

\<MainUnzipBtn>Text on main dialog's unzip button. **Note:** The `MainUnzipLabel` must also be set for this to take effect.\</MainUnzipBtn>

\<MainCloseBtn>Text on main dialog's quit/exit button. **Note:** The `MainUnzipLabel` must also be set for this to take effect.\</MainCloseBtn>

\<MainBrowseBtn>Text on main dialog's browse-for-directory button. **Note:** The `MainUnzipLabel` must also be set for this to take effect.\</MainBrowseBtn>

\<MainUnzipLabel>Caption displayed in main dialog.\</MainUnzipLabel>

\<AutoTemp>0 or 1 (Maps to the `AutoTemp` property)\</AutoTemp>

\<Cleanup>0 or 1 (If 1, extracted files are deleted after the `SetupExe` is run.)\</Cleanup>

\<Debug>0 or 1 (If 1, the EXE will not extract any files.)\</Debug>

\<Verbose>0 or 1 (If 1, verbose information is written to the log.)\</Verbose>

\<ShowFin>0 or 1 (Maps to the `ExeFinishNotifier` property)\</ShowFin>

\<ShowMain>0 or 1 (Maps to the `ExeNoInterface` property)\</ShowMain>

\<ShowProgress>0 or 1 (Maps to the `ExeSilentProgress` property)\</ShowProgress>

\<WaitForSetup>0 or 1 (Maps to the `ExeWaitForSetup` property)\</WaitForSetup>

\<Encryption>0 or 1 (1 = Yes, 0 = No)\</Encryption>

\<KeyLength>128\|192\|256\</KeyLength>

\<SetupExe>EXE to run after extracting. (Maps to the `AutoRun` property)\</SetupExe>

\<UnzipDir>Pre-defined unzip directory. (Maps to the `ExeUnzipDir` property. UNC paths, such as \\\\servername\\path, are not supported.)\</UnzipDir>

\<DefaultDir>Default unzip directory to appear in the main dialog. (Maps to the `ExeDefaultDir` property)\</DefaultDir>

\<IconFile>Icon file to be used (Maps to the `ExeIconFile` property)\</IconFile>

\<MainTitle>Maps to the `ExeTitle` property.\</MainTitle>

\<MainCaption>Maps to the `ExeUnzipCaption` property.\</MainCaption>

\<FinTitle>Title for the finish notifier dialog.\</FinTitle>

\<FinCaption>Caption for the finish notifier dialog.\</FinCaption>

\<ProgressTitle>Title for the progress dialog.\</ProgressTitle>

\<ProgressCaption>Caption for the progress dialog.\</ProgressCaption>

\<PwTitle>Title for the password challenge dialog.\</PwTitle>

\<PwCaption>Caption for the password challenge dialog.\</PwCaption>

\</SfxConfig>

A self-extracting EXE can be run from the command line with the `-log {logFilePath}` option to create a log with information for debugging.

### Zip.FileCount

`Chilkat 11.7.0 · c · Zip · FileCount · property · read-only`

```c
int CkZip_getFileCount(HCkZip cHandle);
```

Number of files in the ZIP, excluding directory entries.

### Zip.FileName

`Chilkat 11.7.0 · c · Zip · FileName · property · read/write`

```c
void CkZip_getFileName(HCkZip cHandle, HCkString retval);
void CkZip_putFileName(HCkZip cHandle, const char *newVal);
const char *CkZip_fileName(HCkZip cHandle);
```

Path of the ZIP file to be written or overwritten.

The default value is the empty string.

### Zip.HasZipFormatErrors

`Chilkat 11.7.0 · c · Zip · HasZipFormatErrors · property · read-only`

```c
BOOL CkZip_getHasZipFormatErrors(HCkZip cHandle);
```

Indicates whether minor ZIP format problems were detected when opening the ZIP archive.

### Zip.HeartbeatMs

`Chilkat 11.7.0 · c · Zip · HeartbeatMs · property · read/write`

```c
int CkZip_getHeartbeatMs(HCkZip cHandle);
void CkZip_putHeartbeatMs(HCkZip cHandle, int newVal);
```

**Full documentation for this property (same in every language):** [Event Callback Examples](https://www.chilkatsoft.com/ai-docs/v/11.7.0/articles/event_callback_examples.md)

Interval, in milliseconds, between abort-check callbacks.

If set to `0`, abort callbacks are disabled.

The default value is `0`.

### Zip.IgnoreAccessDenied

`Chilkat 11.7.0 · c · Zip · IgnoreAccessDenied · property · read/write`

```c
BOOL CkZip_getIgnoreAccessDenied(HCkZip cHandle);
void CkZip_putIgnoreAccessDenied(HCkZip cHandle, BOOL newVal);
```

If `TRUE`, files that cannot be read, written, or created due to filesystem permission errors are skipped.

If `FALSE`, any access-denied error causes the ZIP operation to fail.

The default value is `TRUE`.

### Zip.MaxDate

`Chilkat 11.7.0 · c · Zip · MaxDate · property · read/write · since 10.0.0`

```c
void CkZip_getMaxDate(HCkZip cHandle, HCkString retval);
void CkZip_putMaxDate(HCkZip cHandle, const char *newVal);
const char *CkZip_maxDate(HCkZip cHandle);
```

Maximum last-modified timestamp for files processed during add or extract operations.

Files having modification timestamps later than this value are skipped.

Supports ISO 8601 date/time formats, including:

- `YYYY-MM-DD`  
  Example: `2024-07-31`
- `YYYY-MM-DDTHH:MM:SS±HH:MM`  
  Example: `2024-07-31T12:34:56+02:00`
- `YYYY-MM-DDTHH:MM:SSZ`  
  Example: `2024-07-31T12:34:56Z`

The default value is the empty string, meaning no maximum date restriction.

### Zip.MaxUncompressSize

`Chilkat 11.7.0 · c · Zip · MaxUncompressSize · property · read/write · since 9.5.0.96`

```c
unsigned long CkZip_getMaxUncompressSize(HCkZip cHandle);
void CkZip_putMaxUncompressSize(HCkZip cHandle, unsigned long newVal);
```

Prevents extraction of files larger than the specified uncompressed size.

A value of `0` means no size limit.

The default value is `0`.

### Zip.MinDate

`Chilkat 11.7.0 · c · Zip · MinDate · property · read/write · since 10.0.0`

```c
void CkZip_getMinDate(HCkZip cHandle, HCkString retval);
void CkZip_putMinDate(HCkZip cHandle, const char *newVal);
const char *CkZip_minDate(HCkZip cHandle);
```

Minimum last-modified timestamp for files processed during add or extract operations.

Supports ISO 8601 date/time formats, including:

- `YYYY-MM-DD`  
  Example: `2024-07-31`
- `YYYY-MM-DDTHH:MM:SS±HH:MM`  
  Example: `2024-07-31T12:34:56+02:00`
- `YYYY-MM-DDTHH:MM:SSZ`  
  Example: `2024-07-31T12:34:56Z`

The default value is the empty string, meaning no minimum date restriction.

### Zip.NumEntries

`Chilkat 11.7.0 · c · Zip · NumEntries · property · read-only`

```c
int CkZip_getNumEntries(HCkZip cHandle);
```

Total number of entries in the ZIP, including both files and directories.

### Zip.OemCodePage

`Chilkat 11.7.0 · c · Zip · OemCodePage · property · read/write`

```c
int CkZip_getOemCodePage(HCkZip cHandle);
void CkZip_putOemCodePage(HCkZip cHandle, int newVal);
```

Specifies the OEM code page used for ZIP filename encoding.

Defaults to the OEM code page of the current computer.

### Zip.OverwriteExisting

`Chilkat 11.7.0 · c · Zip · OverwriteExisting · property · read/write`

```c
BOOL CkZip_getOverwriteExisting(HCkZip cHandle);
void CkZip_putOverwriteExisting(HCkZip cHandle, BOOL newVal);
```

If `TRUE`, existing files are overwritten during extraction.

The default value is `TRUE`.

### Zip.PasswordProtect

`Chilkat 11.7.0 · c · Zip · PasswordProtect · property · read/write`

```c
BOOL CkZip_getPasswordProtect(HCkZip cHandle);
void CkZip_putPasswordProtect(HCkZip cHandle, BOOL newVal);
```

Indicates whether the ZIP uses legacy Zip 2.0 password protection.

This property is set automatically when a ZIP archive is opened by any of the `Open*` methods, such as `OpenZip`, `OpenFromMemory`, `OpenBd`, and related methods.

**Important:** `PasswordProtect` and `Encryption` are mutually exclusive.

If `PasswordProtect = TRUE`, then `Encryption` should be `0`.

The default value is `FALSE`.

### Zip.PathPrefix

`Chilkat 11.7.0 · c · Zip · PathPrefix · property · read/write`

```c
void CkZip_getPathPrefix(HCkZip cHandle, HCkString retval);
void CkZip_putPathPrefix(HCkZip cHandle, const char *newVal);
const char *CkZip_pathPrefix(HCkZip cHandle);
```

Gets or sets a path prefix that is prepended to ZIP entry paths for files appended from the local filesystem.

This is useful when you want all extracted files to appear under a specific subdirectory.

This property affects only the following methods:

- `AppendFiles`
- `AppendFilesEx`
- `AddFile`
- `AppendOneFileOrDir`

The `PathPrefix` value is prepended to the stored ZIP path for each appended filesystem file.

For example, set PathPrefix to subdir/ so that files are stored in the ZIP with subdir/ prepended to their paths. When extracted, the files will be placed under the subdir directory.

This property does not affect entries added entirely from memory, such as entries added using:

- `AddString`
- `AddData`
- `AddBd`
- `AddSb`

For in-memory entries, the ZIP entry path is determined solely by the filename/path argument passed to the method.

The default value is the empty string.

### Zip.PercentDoneScale

`Chilkat 11.7.0 · c · Zip · PercentDoneScale · property · read/write · since 9.5.0.49`

```c
int CkZip_getPercentDoneScale(HCkZip cHandle);
void CkZip_putPercentDoneScale(HCkZip cHandle, int newVal);
```

Controls the granularity of PercentDone event callbacks.

This property is only applicable in programming environments that support event callbacks.

The value specifies what should be considered `100%` complete for progress reporting purposes.

- A value of `100` provides whole-percent progress updates.
- A value of `1000` provides tenth-percent granularity.
- For example, with a scale of `1000`, a PercentDone callback value of `453` represents `45.3%` complete.

Increasing this value allows for more frequent and finer-grained progress callbacks during long-running operations.

The value is automatically clamped to the range:

- Minimum: `10`
- Maximum: `100000`

The default value is `100`.

### Zip.PwdProtCharset

`Chilkat 11.7.0 · c · Zip · PwdProtCharset · property · read/write · since 9.5.0.73`

```c
void CkZip_getPwdProtCharset(HCkZip cHandle, HCkString retval);
void CkZip_putPwdProtCharset(HCkZip cHandle, const char *newVal);
const char *CkZip_pwdProtCharset(HCkZip cHandle);
```

Specifies the character encoding used to convert the decrypt password into its binary byte representation for legacy password-protected ZIP archives that use Zip 2.0 encryption.

The default value is `ansi`.

Other possible values include:

- `cp850`
- `cp437`
- Any supported Windows or OEM code page listed at the link below.

This property applies only to older Zip 2.0 password protection and is not used for AES-encrypted ZIP archives.

### Zip.TempDir

`Chilkat 11.7.0 · c · Zip · TempDir · property · read/write`

```c
void CkZip_getTempDir(HCkZip cHandle, HCkString retval);
void CkZip_putTempDir(HCkZip cHandle, const char *newVal);
const char *CkZip_tempDir(HCkZip cHandle);
```

Directory used for temporary files during ZIP operations.

When overwriting an existing ZIP file, a temporary file is used to avoid corrupting the original ZIP if an error occurs.

The default value depends on the runtime environment.

### Zip.UncommonOptions

`Chilkat 11.7.0 · c · Zip · UncommonOptions · property · read/write · since 9.5.0.84`

```c
void CkZip_getUncommonOptions(HCkZip cHandle, HCkString retval);
void CkZip_putUncommonOptions(HCkZip cHandle, const char *newVal);
const char *CkZip_uncommonOptions(HCkZip cHandle);
```

Advanced options for uncommon scenarios.

- `ForceZip64` → Forces ZIP64 format even when not required.

The default value is the empty string.

### Zip.Zipx

`Chilkat 11.7.0 · c · Zip · Zipx · property · read/write`

```c
BOOL CkZip_getZipx(HCkZip cHandle);
void CkZip_putZipx(HCkZip cHandle, BOOL newVal);
```

If `TRUE`, creates ZIPX archives using the most appropriate compression method for each file.

The default value is `FALSE`.

### Zip.ZipxDefaultAlg

`Chilkat 11.7.0 · c · Zip · ZipxDefaultAlg · property · read/write`

```c
void CkZip_getZipxDefaultAlg(HCkZip cHandle, HCkString retval);
void CkZip_putZipxDefaultAlg(HCkZip cHandle, const char *newVal);
const char *CkZip_zipxDefaultAlg(HCkZip cHandle);
```

Default compression algorithm used when creating ZIPX archives.

- Possible values include:
  - `deflate`
  - `ppmd`
  - `lzma`
  - `bzip2`
  - `deflate64`

The default value is `deflate`.

## Methods

### Zip.AddBd

`Chilkat 11.7.0 · c · Zip · AddBd · method · since 11.0.0`

```c
BOOL CkZip_AddBd(HCkZip cHandle, const char *pathInZip, HCkBinData bd);
```

Adds the contents of a `BinData` object as a new entry in the ZIP archive.

- `pathInZip` specifies the filename and optional directory path stored within the ZIP.
- The bytes contained in `bd` become the contents of the ZIP entry.
- The entry is added to the in-memory ZIP object and is not written to disk until `WriteZip`, `WriteZipAndClose`, `WriteBd`, or `WriteToMemory` is called.

Returns TRUE for success, FALSE for failure.

### Zip.AddEmpty

`Chilkat 11.7.0 · c · Zip · AddEmpty · method · since 11.0.0`

```c
BOOL CkZip_AddEmpty(HCkZip cHandle, BOOL isDir, const char *pathInZip);
```

Adds an empty file or directory entry to the ZIP archive.

- If `isDir = TRUE`, an empty directory entry is created.
- If `isDir = FALSE`, an empty file entry is created.
- `pathInZip` specifies the path stored in the ZIP archive.

This method is useful when directory structure entries must exist even if no files are present.

Returns TRUE for success, FALSE for failure.

### Zip.AddEncoded

`Chilkat 11.7.0 · c · Zip · AddEncoded · method · since 11.0.0`

```c
BOOL CkZip_AddEncoded(HCkZip cHandle, const char *pathInZip, const char *encoding, const char *data);
```

Adds encoded binary data as a ZIP entry.

- `encoding` specifies how `data` is encoded.
- Common encodings include `base64` and `hex`.
- The decoded binary bytes become the contents of the ZIP entry.

This method is useful when binary data already exists in textual encoded form.

Returns TRUE for success, FALSE for failure.

### Zip.AddFile

`Chilkat 11.7.0 · c · Zip · AddFile · method · since 11.0.0`

```c
BOOL CkZip_AddFile(HCkZip cHandle, const char *localPath, BOOL saveExtraPath);
```

Adds a file or directory from the local filesystem to the ZIP archive.

- If `localPath` is an absolute path and `saveExtraPath = TRUE`, the stored ZIP path includes the relative directory structure.
- If `saveExtraPath = FALSE`, only the filename is stored.
- If `localPath` is already relative, the relative path is stored as-is regardless of `saveExtraPath`.

This method adds a reference to the file or directory in the local filesystem. The file data is not immediately read or compressed.

The actual file contents are consumed only when a `Write*` method is called, such as:

- `WriteZip`
- `WriteZipAndClose`
- `WriteBd`
- `WriteToMemory`

This allows files and data entries to be accumulated in the in-memory ZIP object prior to writing the final ZIP archive.

Returns TRUE for success, FALSE for failure.

### Zip.AddNoCompressExtension

`Chilkat 11.7.0 · c · Zip · AddNoCompressExtension · method`

```c
void CkZip_AddNoCompressExtension(HCkZip cHandle, const char *fileExtension);
```

Adds a file extension to the internal "no-compression" list.

Files having these extensions are stored without compression because they are already compressed or because compression would provide little benefit.

For example:

- `.zip`
- `.jpg`
- `.png`
- `.gz`

The extension may be specified with or without the leading dot.

Additional extensions remain active for the lifetime of the Zip object unless removed with `RemoveNoCompressExtension`.

### Zip.AddSb

`Chilkat 11.7.0 · c · Zip · AddSb · method · since 11.0.0`

```c
BOOL CkZip_AddSb(HCkZip cHandle, const char *pathInZip, HCkStringBuilder sb, const char *charset);
```

Adds the contents of a `StringBuilder` object as a text entry in the ZIP archive.

- The text is converted to bytes using the specified `charset`.
- `pathInZip` specifies the filename stored in the ZIP.

Returns TRUE for success, FALSE for failure.

### Zip.AddString

`Chilkat 11.7.0 · c · Zip · AddString · method · since 11.0.0`

```c
BOOL CkZip_AddString(HCkZip cHandle, const char *pathInZip, const char *content, const char *charset);
```

Adds a string as a text file entry in the ZIP archive.

- The string is converted to bytes using the specified `charset`.
- `pathInZip` specifies the path stored within the ZIP archive.

This method is useful for dynamically generating text files directly in memory.

Returns TRUE for success, FALSE for failure.

### Zip.AppendFiles

`Chilkat 11.7.0 · c · Zip · AppendFiles · method`

```c
BOOL CkZip_AppendFiles(HCkZip cHandle, const char *filePattern, BOOL recurse);
```

Adds one or more files matching a wildcard pattern.

- The wildcard character `*` matches zero or more characters.
- If `recurse = TRUE`, subdirectories are processed recursively.
- If `recurse = FALSE`, only the current directory is searched.

For example:

> `AppendFiles("c:/temp/*.txt", FALSE)`

This method only updates the in-memory ZIP object. The ZIP file itself is not written until a `Write*` method is called.

Returns TRUE for success, FALSE for failure.

Async variant: `AppendFilesAsync` — same arguments, returns a `Task` (see Async variants below).

### Zip.AppendFilesEx

`Chilkat 11.7.0 · c · Zip · AppendFilesEx · method`

```c
BOOL CkZip_AppendFilesEx(HCkZip cHandle, const char *filePattern, BOOL recurse, BOOL saveExtraPath, BOOL archiveOnly, BOOL includeHidden, BOOL includeSystem);
```

Advanced version of `AppendFiles` with additional filtering and path options.

- `saveExtraPath` controls whether the extra leading path information from the `filePattern` is preserved in the ZIP.
- `archiveOnly` applies only on Windows and limits processing to files having the archive attribute set.
- `includeHidden` controls whether hidden files are included.
- `includeSystem` controls whether files with the System attribute are included.

This method adds references to files in the in-memory ZIP object. No ZIP file is written until a `Write*` method is called.

Returns TRUE for success, FALSE for failure.

Async variant: `AppendFilesExAsync` — same arguments, returns a `Task` (see Async variants below).

### Zip.AppendZip

`Chilkat 11.7.0 · c · Zip · AppendZip · method`

```c
BOOL CkZip_AppendZip(HCkZip cHandle, const char *zipPath);
```

**Note:** This method is currently not working and will be fixed in v11.5.0

Adds all entries from another existing ZIP archive into the current ZIP object.

The `zipPath` argument specifies the path of a ZIP file located in the local filesystem.

All entries from the specified ZIP archive are appended to the current in-memory ZIP object.

The ZIP archive itself is not rewritten until a `Write*` method is called.

This method is useful for merging the contents of multiple ZIP archives into a single ZIP.

Returns TRUE for success, FALSE for failure.

### Zip.CloseZip

`Chilkat 11.7.0 · c · Zip · CloseZip · method`

```c
void CkZip_CloseZip(HCkZip cHandle);
```

Closes the currently open ZIP archive and clears all entries from the Zip object.

This method has the same effect as calling `NewZip` without specifying a filename.

### Zip.DeleteEntry

`Chilkat 11.7.0 · c · Zip · DeleteEntry · method`

```c
BOOL CkZip_DeleteEntry(HCkZip cHandle, HCkZipEntry entry);
```

Removes a ZIP entry from the current ZIP object.

The ZIP file itself is not rewritten until a `Write*` method is called.

Returns TRUE for success, FALSE for failure.

### Zip.EntryAt

`Chilkat 11.7.0 · c · Zip · EntryAt · method · since 11.0.0`

```c
BOOL CkZip_EntryAt(HCkZip cHandle, int index, HCkZipEntry entry);
```

Retrieves the ZIP entry at the specified zero-based index.

- The first entry is at index `0`.
- The matching entry is returned in the supplied `ZipEntry` object.

Returns TRUE for success, FALSE for failure.

### Zip.EntryById

`Chilkat 11.7.0 · c · Zip · EntryById · method · since 11.0.0`

```c
BOOL CkZip_EntryById(HCkZip cHandle, int id, HCkZipEntry entry);
```

Finds a ZIP entry by its unique EntryID.

The matching entry is returned in the supplied `ZipEntry` object.

Returns TRUE for success, FALSE for failure.

### Zip.EntryMatching

`Chilkat 11.7.0 · c · Zip · EntryMatching · method · since 11.0.0`

```c
BOOL CkZip_EntryMatching(HCkZip cHandle, const char *pattern, HCkZipEntry entry);
```

Finds the first ZIP entry whose stored path matches a wildcard pattern.

- The wildcard character `*` matches zero or more characters.
- The comparison is performed against the full stored ZIP path.

Returns TRUE for success, FALSE for failure.

### Zip.EntryOf

`Chilkat 11.7.0 · c · Zip · EntryOf · method · since 11.0.0`

```c
BOOL CkZip_EntryOf(HCkZip cHandle, const char *pathInZip, HCkZipEntry entry);
```

Finds a ZIP entry whose stored path exactly matches `pathInZip`.

The matching entry is returned in the supplied `ZipEntry` object.

Returns TRUE for success, FALSE for failure.

### Zip.ExcludeDir

`Chilkat 11.7.0 · c · Zip · ExcludeDir · method`

```c
void CkZip_ExcludeDir(HCkZip cHandle, const char *dirName);
```

Adds a directory name to the exclusion list used by recursive append operations.

- All directories having the specified name are skipped.
- The comparison is case-insensitive.
- Call multiple times to exclude multiple directory names.

This affects methods such as `AppendFiles` and `AppendFilesEx`.

### Zip.ExtractExe

`Chilkat 11.7.0 · c · Zip · ExtractExe · method · since 9.5.0.44`

```c
BOOL CkZip_ExtractExe(HCkZip cHandle, const char *exePath, const char *dirPath);
```

Extracts files from a Chilkat-created self-extracting EXE.

- Files are extracted into `dirPath`.
- Subdirectories are automatically created as needed.
- If the EXE is encrypted, `DecryptPassword` must be set before extraction.

Returns TRUE for success, FALSE for failure.

Async variant: `ExtractExeAsync` — same arguments, returns a `Task` (see Async variants below).

### Zip.GetDirectoryAsXML

`Chilkat 11.7.0 · c · Zip · GetDirectoryAsXML · method`

```c
BOOL CkZip_GetDirectoryAsXML(HCkZip cHandle, HCkString outXml);
const char *CkZip_getDirectoryAsXML(HCkZip cHandle);
```

Returns the ZIP directory structure as an XML document.

The returned XML contains information about the entries currently contained within the ZIP archive, including files and directories.

This method is useful for inspecting ZIP contents without extracting files.

Returns the XML document as a string.

Returns TRUE for success, FALSE for failure.

### Zip.GetExeConfigParam

`Chilkat 11.7.0 · c · Zip · GetExeConfigParam · method`

```c
BOOL CkZip_GetExeConfigParam(HCkZip cHandle, const char *name, HCkString outStr);
const char *CkZip_getExeConfigParam(HCkZip cHandle, const char *name);
```

`(Windows only, for creating self-extracting EXE's)`

Returns the value of a configuration parameter embedded within a self-extracting EXE.

The `name` argument should be one of the XML tag names described in the `ExeXmlConfig` property documentation.

For example:

- `MainTitle`
- `MainCaption`
- `SetupExe`

Returns the parameter value as a string.

Returns TRUE for success, FALSE for failure.

### Zip.GetMaxUncompressedSize

`Chilkat 11.7.0 · c · Zip · GetMaxUncompressedSize · method · since 9.5.0.96`

```c
BOOL CkZip_GetMaxUncompressedSize(HCkZip cHandle, HCkString outStr);
const char *CkZip_getMaxUncompressedSize(HCkZip cHandle);
```

Returns the largest uncompressed file size contained within the ZIP archive.

The size is returned as a string rather than an integer because the value may exceed the range of a 32-bit integer.

This method is useful when:

- Checking for extremely large files before extraction
- Estimating required disk space
- Detecting unusually large compressed entries

Returns the size as a decimal string.

Returns TRUE for success, FALSE for failure.

### Zip.IsNoCompressExtension

`Chilkat 11.7.0 · c · Zip · IsNoCompressExtension · method`

```c
BOOL CkZip_IsNoCompressExtension(HCkZip cHandle, const char *fileExtension);
```

Checks whether a file extension is contained in the internal "no-compression" extension list.

Files having extensions in this list are stored without compression because they are typically already compressed.

The extension may be specified with or without the leading dot.

For example, both of the following are valid:

- `.jpg`
- `jpg`

Returns `TRUE` if the extension exists in the list, otherwise returns `FALSE`.

### Zip.IsPasswordProtected

`Chilkat 11.7.0 · c · Zip · IsPasswordProtected · method`

```c
BOOL CkZip_IsPasswordProtected(HCkZip cHandle, const char *zipPath);
```

Checks whether a ZIP archive uses legacy Zip 2.0 password protection.

The `zipPath` argument specifies the path of a ZIP file in the local filesystem.

This method checks only for traditional Zip 2.0 password protection.

Returns `TRUE` if the ZIP archive is password protected, otherwise returns `FALSE`.

### Zip.LoadTaskCaller

`Chilkat 11.7.0 · c · Zip · LoadTaskCaller · method · since 9.5.0.80`

```c
BOOL CkZip_LoadTaskCaller(HCkZip cHandle, HCkTask task);
```

Loads the caller of the task's async method.

Returns TRUE for success, FALSE for failure.

### Zip.NewZip

`Chilkat 11.7.0 · c · Zip · NewZip · method`

```c
BOOL CkZip_NewZip(HCkZip cHandle, const char *zipPath);
```

Initializes a new empty ZIP archive.

- If another ZIP archive is currently open, it is closed.
- All existing in-memory ZIP entries are discarded.
- The `FileName` property is set to `zipPath`.

No ZIP file is actually created until a `Write*` method is called.

This method resets the Zip object to a clean empty state.

Returns TRUE for success, FALSE for failure.

### Zip.OpenBd

`Chilkat 11.7.0 · c · Zip · OpenBd · method · since 9.5.0.66`

```c
BOOL CkZip_OpenBd(HCkZip cHandle, HCkBinData binData);
```

Opens a ZIP archive contained entirely within a `BinData` object.

This method allows ZIP archives to be processed entirely in memory without requiring a filesystem file.

When a ZIP archive is opened:

- `PasswordProtect` is automatically set if legacy Zip 2.0 encryption is detected.
- `Encryption` is automatically set if strong encryption is detected.
- A value of `4` for `Encryption` indicates WinZip-compatible AES encryption.

Returns TRUE for success, FALSE for failure.

### Zip.OpenEmbedded

`Chilkat 11.7.0 · c · Zip · OpenEmbedded · method`

```c
BOOL CkZip_OpenEmbedded(HCkZip cHandle, const char *exeFilename, const char *resourceName);
```

`(Windows only)`

Opens a ZIP archive embedded as a resource within a Windows executable.

- `exeFilename` specifies the EXE file path.
- `resourceName` specifies the embedded resource name containing the ZIP data.

This method is useful when ZIP archives are packaged within Windows applications.

Returns TRUE for success, FALSE for failure.

### Zip.OpenZip

`Chilkat 11.7.0 · c · Zip · OpenZip · method`

```c
BOOL CkZip_OpenZip(HCkZip cHandle, const char *zipPath);
```

Opens a ZIP archive from the local filesystem.

The `zipPath` argument specifies the path of the ZIP file to open.

Encrypted ZIP archives may be opened without providing a password, but encrypted entries cannot be extracted until the correct password is provided using `DecryptPassword`.

When the ZIP archive is opened:

- `PasswordProtect` is automatically set if legacy Zip 2.0 encryption is detected.
- `Encryption` is automatically set if strong encryption is detected.
- `Encryption = 4` indicates WinZip-compatible AES encryption.

Returns TRUE for success, FALSE for failure.

Async variant: `OpenZipAsync` — same arguments, returns a `Task` (see Async variants below).

### Zip.QuickAppend

`Chilkat 11.7.0 · c · Zip · QuickAppend · method`

```c
BOOL CkZip_QuickAppend(HCkZip cHandle, const char *zipPath);
```

Efficiently appends additional entries to an existing ZIP archive.

The `zipPath` argument specifies the path of an existing ZIP archive in the local filesystem.

This method avoids rewriting existing entries.

- Existing ZIP entries remain unchanged.
- New entries are appended to the end of the ZIP archive.
- The ZIP central directory is updated accordingly.

This method is typically faster than rebuilding the entire ZIP archive.

Returns TRUE for success, FALSE for failure.

Async variant: `QuickAppendAsync` — same arguments, returns a `Task` (see Async variants below).

### Zip.RemoveNoCompressExtension

`Chilkat 11.7.0 · c · Zip · RemoveNoCompressExtension · method`

```c
void CkZip_RemoveNoCompressExtension(HCkZip cHandle, const char *fileExtension);
```

Removes a file extension from the internal "no-compression" extension list.

After removal, files having this extension may be compressed normally.

The extension may be specified with or without the leading dot.

### Zip.SetCompressionLevel

`Chilkat 11.7.0 · c · Zip · SetCompressionLevel · method`

```c
void CkZip_SetCompressionLevel(HCkZip cHandle, int level);
```

Sets the compression level for all file and data entries currently contained within the ZIP object.

- `0` → No compression
- `9` → Maximum compression

The default compression level is `6`.

**Important:** This method should be called after files or data entries have already been added to the ZIP object.

The compression level cannot be changed for mapped entries originating from an already-open ZIP archive.

### Zip.SetExclusions

`Chilkat 11.7.0 · c · Zip · SetExclusions · method`

```c
void CkZip_SetExclusions(HCkZip cHandle, HCkStringArray excludePatterns);
```

Specifies a collection of wildcard exclusion patterns used when adding files to the ZIP archive.

Each pattern may use the wildcard character `*` to match zero or more characters.

Files matching any exclusion pattern are skipped.

### Zip.SetExeConfigParam

`Chilkat 11.7.0 · c · Zip · SetExeConfigParam · method`

```c
void CkZip_SetExeConfigParam(HCkZip cHandle, const char *paramName, const char *paramValue);
```

`(Windows only, for creating self-extracting EXE's)`

Sets a configuration parameter embedded within a self-extracting EXE created by `WriteExe` or `WriteExe2`.

The `paramName` should be one of the XML configuration tag names described in the `ExeXmlConfig` property documentation.

For example:

> `SetExeConfigParam("MainUnzipBtn","Extract")`

This changes the text displayed on the self-extractor's main unzip button.

### Zip.Unzip

`Chilkat 11.7.0 · c · Zip · Unzip · method`

```c
int CkZip_Unzip(HCkZip cHandle, const char *dirPath);
```

Extracts all files and directories from the ZIP archive.

- `dirPath` specifies the destination directory.
- Subdirectories are automatically created as needed.

Returns the number of files extracted.

Returns `-1` if a failure occurs.

Async variant: `UnzipAsync` — same arguments, returns a `Task` (see Async variants below).

### Zip.UnzipInto

`Chilkat 11.7.0 · c · Zip · UnzipInto · method`

```c
int CkZip_UnzipInto(HCkZip cHandle, const char *dirPath);
```

Extracts all files into a single directory.

All directory path information stored within the ZIP archive is ignored.

If multiple files have the same filename, later extracted files overwrite earlier ones.

Returns the number of files extracted, or `-1` on failure.

Async variant: `UnzipIntoAsync` — same arguments, returns a `Task` (see Async variants below).

### Zip.UnzipMatching

`Chilkat 11.7.0 · c · Zip · UnzipMatching · method`

```c
int CkZip_UnzipMatching(HCkZip cHandle, const char *dirPath, const char *pattern, BOOL verbose);
```

Extracts only entries whose stored paths match a wildcard pattern.

- The wildcard character `*` matches zero or more characters.
- If no wildcard is used, an exact filename match is required.

Subdirectories are automatically created as needed.

Returns the number of files extracted, or `-1` on failure.

Async variant: `UnzipMatchingAsync` — same arguments, returns a `Task` (see Async variants below).

### Zip.UnzipMatchingInto

`Chilkat 11.7.0 · c · Zip · UnzipMatchingInto · method`

```c
int CkZip_UnzipMatchingInto(HCkZip cHandle, const char *dirPath, const char *pattern, BOOL verbose);
```

Extracts matching entries into a single directory while ignoring all stored ZIP path information.

Matching behavior is identical to `UnzipMatching`.

If duplicate filenames occur, later extracted files overwrite earlier ones.

Returns the number of files extracted, or `-1` on failure.

Async variant: `UnzipMatchingIntoAsync` — same arguments, returns a `Task` (see Async variants below).

### Zip.UnzipNewer

`Chilkat 11.7.0 · c · Zip · UnzipNewer · method`

```c
int CkZip_UnzipNewer(HCkZip cHandle, const char *dirPath);
```

Extracts only files that:

- Do not already exist
- Or have older modification timestamps than the ZIP entry

Subdirectories are automatically created as needed.

Returns the number of files extracted, or `-1` on failure.

Async variant: `UnzipNewerAsync` — same arguments, returns a `Task` (see Async variants below).

### Zip.VerifyPassword

`Chilkat 11.7.0 · c · Zip · VerifyPassword · method`

```c
BOOL CkZip_VerifyPassword(HCkZip cHandle);
```

Verifies that the current `DecryptPassword` value is correct for the currently opened ZIP archive.

This method allows password validation before attempting extraction.

Returns `TRUE` if the password is valid, otherwise returns `FALSE`.

### Zip.WriteBd

`Chilkat 11.7.0 · c · Zip · WriteBd · method · since 9.5.0.66`

```c
BOOL CkZip_WriteBd(HCkZip cHandle, HCkBinData binData);
```

Writes the ZIP archive to a `BinData` object instead of a filesystem file.

The generated ZIP archive exists entirely in memory.

The ZIP data written by this method may later be opened using `OpenBd`.

Returns TRUE for success, FALSE for failure.

Async variant: `WriteBdAsync` — same arguments, returns a `Task` (see Async variants below).

### Zip.WriteExe

`Chilkat 11.7.0 · c · Zip · WriteExe · method`

```c
BOOL CkZip_WriteExe(HCkZip cHandle, const char *exeFilename);
```

`(Windows only, for creating self-extracting EXE's)`

Creates a Windows self-extracting executable (EXE).

The generated EXE contains both the extraction logic and the ZIP archive data.

There are no limitations on:

- Total ZIP size
- Individual file size
- Number of files

The generated EXE supports the following command-line arguments:

- `-log logFileName`
- `-unzipDir unzipDirectoryPath`
- `-pwd password`
- `-ap autoRunParams`

Returns TRUE for success, FALSE for failure.

Async variant: `WriteExeAsync` — same arguments, returns a `Task` (see Async variants below).

See also:

- [More information about self-extracting executables.](http://www.cknotes.com/?p=351)

### Zip.WriteZip

`Chilkat 11.7.0 · c · Zip · WriteZip · method`

```c
BOOL CkZip_WriteZip(HCkZip cHandle);
```

Saves the Zip to a file and implictly re-opens it so further operations can continue. Use WriteZipAndClose to write and close the Zip. There is no limitation on the size of files that may be contained within a .zip, the total number of files in a .zip, or the total size of a .zip. If necessary, WriteZip will use the ZIP64 file format extensions when 4GB or file count limitations of the old zip file format are exceeded.

Returns TRUE for success, FALSE for failure.

Async variant: `WriteZipAsync` — same arguments, returns a `Task` (see Async variants below).

### Zip.WriteZipAndClose

`Chilkat 11.7.0 · c · Zip · WriteZipAndClose · method`

```c
BOOL CkZip_WriteZipAndClose(HCkZip cHandle);
```

Saves the Zip to a file and closes it. On return, the Zip object will be in the state as if NewZip had been called. There is no limitation on the size of files that may be contained within a .zip, the total number of files in a .zip, or the total size of a .zip. If necessary, WriteZip will use the ZIP64 file format extensions when 4GB or file count limitations of the old zip file format are exceeded.

Returns TRUE for success, FALSE for failure.

Async variant: `WriteZipAndCloseAsync` — same arguments, returns a `Task` (see Async variants below).

## Events and callbacks

This binding delivers progress information through callbacks (AbortCheck, PercentDone, ProgressInfo, TaskCompleted) rather than events. See `guide.md` for how to attach them in C.

## Async variants

Each returns a `Task` instead of the result and takes the same arguments as the synchronous method; run the task, wait for `Finished`, then read the result from the task. No new Async methods are added from 11.7.0 on.

```c
HCkTask CkZip_AppendFilesAsync(HCkZip cHandle, const char *filePattern, BOOL recurse);
HCkTask CkZip_AppendFilesExAsync(HCkZip cHandle, const char *filePattern, BOOL recurse, BOOL saveExtraPath, BOOL archiveOnly, BOOL includeHidden, BOOL includeSystem);
HCkTask CkZip_ExtractExeAsync(HCkZip cHandle, const char *exePath, const char *dirPath);
HCkTask CkZip_OpenZipAsync(HCkZip cHandle, const char *zipPath);
HCkTask CkZip_QuickAppendAsync(HCkZip cHandle, const char *zipPath);
HCkTask CkZip_UnzipAsync(HCkZip cHandle, const char *dirPath);
HCkTask CkZip_UnzipIntoAsync(HCkZip cHandle, const char *dirPath);
HCkTask CkZip_UnzipMatchingAsync(HCkZip cHandle, const char *dirPath, const char *pattern, BOOL verbose);
HCkTask CkZip_UnzipMatchingIntoAsync(HCkZip cHandle, const char *dirPath, const char *pattern, BOOL verbose);
HCkTask CkZip_UnzipNewerAsync(HCkZip cHandle, const char *dirPath);
HCkTask CkZip_WriteBdAsync(HCkZip cHandle, HCkBinData binData);
HCkTask CkZip_WriteExeAsync(HCkZip cHandle, const char *exeFilename);
HCkTask CkZip_WriteZipAsync(HCkZip cHandle);
HCkTask CkZip_WriteZipAndCloseAsync(HCkZip cHandle);
```

## Deprecated members — do not use in new code

| Member | Kind | Deprecated in | Use instead |
|---|---|---|---|
| `AppendBd` | method | before 11.6.1 | `AddBd` |
| `AppendData` | method | before 11.6.1 | `AddData` |
| `AppendDataEncoded` | method | before 11.6.1 | `AddEncoded` |
| `AppendNew` | method | before 11.6.1 | `AddEmpty` |
| `AppendNewDir` | method | before 11.6.1 | `AddEmpty` |
| `AppendOneFileOrDir` | method | before 11.6.1 | `AddFile` |
| `AppendSb` | method | before 11.6.1 | `AddSb` |
| `AppendString` | method | before 11.6.1 | `AddString` |
| `AppendString2` | method | before 11.6.1 | `AddString` |
| `FirstEntry` | method | before 11.6.1 | `EntryAt` |
| `FirstMatchingEntry` | method | before 11.6.1 | `EntryMatching` |
| `GetEntryByID` | method | before 11.6.1 | `EntryById` |
| `GetEntryByIndex` | method | before 11.6.1 | `EntryAt` |
| `GetEntryByName` | method | before 11.6.1 | `EntryOf` |
| `GetExclusions` | method | before 11.6.1 | — |
| `OpenFromByteData` | method | before 11.6.1 | — |
| `OpenFromMemory` | method | before 11.6.1 | — |
| `SetPassword` | method | before 11.6.1 | — |
| `WriteExeToMemory` | method | before 11.6.1 | — |
| `WriteToMemory` | method | before 11.6.1 | — |

## Related classes

[`BinData`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/c/classes/BinData.md), [`StringArray`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/c/classes/StringArray.md), [`StringBuilder`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/c/classes/StringBuilder.md), [`Task`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/c/classes/Task.md), [`ZipEntry`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/c/classes/ZipEntry.md)

