> ## Documentation Index
> Fetch the complete documentation index at: https://docs.arc.cdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Zip Connector

> Automatically compress and decompress archives in multiple formats (7zip, Bzip2, Gzip, Tar) with password protection and scheduled send support.

The Zip connector supports automatic compression and decompression of archives in various formats.

## Key Capabilities

* File compression and extraction with support for multiple archive formats (7zip, Bzip2, Gzip, and Tar)
* Password protection and encryption capabilities for secure archives
* Scheduled Send functionality to combine multiple files into single archives
* Configurable compression methods and levels for optimized file sizes and processing speed

## Overview

Zip connectors automatically compress or decompress incoming files depending on the **Operation** setting of the connector. In *Compress* mode, each file is zipped independently, so the number of output Zip archives is equal to the number of input files. In *Decompress* mode, all files are extracted from input archives and output as an individual file; folder structure is ignored.

Zip connectors can be configured to compress and decompress archives in a variety of formats, including 7zip, Bzip2, Gzip, and Tar.

## Connector Configuration

This section contains all of the configurable connector properties.

### Settings Tab

#### Configuration

*Settings related to the core operation of the connector.*

| Setting | Description |
| - | - |
| **Connector Id** | The static, unique identifier for the connector. |
| **Connector Type** | Displays the connector name and a description of what it does. |
| **Connector Description** | An optional field to provide a free-form description of the connector and its role in the flow. |
| **Operation** | Whether the connector is compressing or decompressing incoming files. Trying to decompress files that are not compressed in a supported format results in an error. |

#### Archive Options

*Settings related to the archive being processed or created.*

| Setting | Description |
| - | - |
| **Archive Format** | The expected format of the input archive (when decompressing), or the format of the archive that is created (when compressing). |
| **Compression Method** | The specific algorithm to use when compressing. |
| **Compression Level** | The level of compression to apply when compressing. Higher values allow better compression; lower values allow faster compression. A value of 0 stores the file without compression. |

#### Encryption

*Settings related to encrypting archives during compression, if allowed by the archive format.*

| Setting | Description |
| - | - |
| **Encryption Algorithm** | The algorithm to use when encrypting. |
| **Password** | The password required to decrypt the archive. |

### Advanced Tab

#### Advanced Settings

*Settings not included in the previous categories.*

| Setting | Description |
| - | - |
| **Extract To Folder** | The folder where the connector should place files extracted from an archive. |
| **Local File Scheme** | A scheme for assigning filenames to messages that are output by the connector. You can use macros in your filenames dynamically to include information such as identifiers and timestamps. For more information, see [Macros](#macros). |

#### Message

*Message settings determine how the connector searches for messages and manages them after processing.*

**Note:** The settings below are deprecated and hidden by default. They appear only on connectors where they were previously enabled or configured to a non-default value. To retain copies of successfully processed files, right-click the connector in the flow, choose **Show Success Path**, and connect the success path to a [File connector](https://docs.arc.cdata.com/26.4/self-hosted/en/connectors/file.md).

<table><thead><tr><th>Setting</th><th>Description</th></tr></thead>
<tbody><tr><td>**Save to Sent Folder** (Deprecated)</td>
<td>Copies files processed by the connector to the Sent folder. Disabled by default. Files saved to the Sent folder are not covered by [Encryption at Rest](https://docs.arc.cdata.com/26.4/self-hosted/en/getting-started/administration/settings/encryption-at-rest.md).</td></tr>
<tr><td>**Sent Folder Scheme** (Deprecated)</td>
<td>Groups files in the **Sent** folder by the selected time interval. Only relevant when **Save to Sent Folder** is enabled.</td></tr></tbody></table>

#### Logging

*Settings that govern the creation and storage of logs.*

<table><thead><tr><th>Setting</th>
<th>Description</th></tr></thead>
<tbody><tr><td>**Log Level**</td>
<td>The verbosity of logs generated by the connector. When you request support, set this to **Debug**.</td></tr>
<tr><td>**Log Subfolder Scheme**</td>
<td>Instructs the connector to group files in the Logs folder according to the selected interval. The **Weekly** option (which is the default) instructs the connector to create a new subfolder each week and store all logs for the week in that folder. Leaving this setting blank tells the connector to save all logs directly in the Logs folder. For connectors that process many transactions, using subfolders helps keep logs organized and improves performance.</td></tr>
<tr><td>**Log Messages**</td>
<td>Check this to have the log entry for a processed file include a copy of the file itself. If you disable this, you might not be able to download a copy of the file from the **Transactions** tab.</td></tr></tbody></table>

#### Other Settings

| Setting | Description |
| - | - |
| **Processing Delay** | The amount of time (in seconds) by which the processing of files placed in the **Transactions** tab is delayed. This is a legacy setting. Best practice is to [use a File connector](https://docs.arc.cdata.com/26.4/self-hosted/en/flows/designing-a-flow.md#interacting-with-the-local-file-system) to manage local file systems instead of this setting. |

#### Miscellaneous

*Miscellaneous settings are for specific use cases.*

<table><thead><tr><th>Setting</th>
<th>Description</th></tr></thead>
<tbody><tr><td>**Other Settings**</td>
<td>Enables you to configure hidden connector settings in a semicolon-separated list (for example, `setting1=value1;setting2=value2`). Normal connector use cases and functionality should not require the use of these settings.</td></tr></tbody></table>

### Automation Tab

#### Automation Settings

*Settings related to the automatic processing of files by the connector.*

By default, the **Enable automation** checkbox is checked. If you uncheck it, you cannot use the other automation settings.

| Setting | Description |
| - | - |
| **Send** | Whether messages arriving at the connector are automatically processed. |
| **Scheduled Send** | Whether to process incoming messages at a scheduled interval. This allows multiple files to accumulate in the input folder, then all be zipped together in the same archive. **Note**: The following archive formats do not support compressing multiple files: Bzip, Gzip, and Zcompress. An error is generated if this setting is enabled on those archive formats. |
| **Send Interval** | The interval at which to compress all available input files into the same archive. Only available if **Scheduled Send** is enabled. |
| **Minutes Past the Hour** | The minutes offset for an hourly schedule. Only applicable when the interval setting above is set to *Hourly*. |
| **Time** | The time of day that the attempt should occur. Only applicable when the interval setting above is set to *Daily*, *Weekly*, or *Monthly*. |
| **Day** | The day on which the attempt should occur. Only applicable when the interval setting above is set to *Weekly* or *Monthly*. |
| **Minutes** | The number of minutes to wait before attempting the download. Only applicable when the interval setting above is set to *Minute*. |
| **Cron Expression** | A five-position string representing a cron expression that determines when the attempt should occur. Only applicable when the interval setting above is set to *Advanced*. |
| **Start Date and Time** | The date and time at which the automation first runs. Every run after that follows the interval setting above. The last and next run times appear in the [Automation Status](#automation-status) section. |

#### Automation Status

*A read-only summary of whether the automation is running, what happened on the last run, and when the next run occurs.*

The **Automation Status** card appears under the **Enabled** checkbox on the **Automation** tab for **Receive**, **Download**, and **Scheduled Send** automation. The card answers three questions: whether the automation ran, whether the run worked, and when the next run occurs.

The card updates as you change the **Enabled** checkbox, or the **Interval** or **Start Date and Time** settings, before you save the connector.

![The Automation Status card on the Automation tab showing a Suspended status, a Failed last processed result, and the next run time](https://docs.arc.cdata.com/26.4/images/automation-status-card.png)

Status

The current state of the automation for the connector.

<table><thead><tr><th>Status</th>
<th>Description</th></tr></thead>
<tbody><tr><td>**In Progress**</td>
<td>A run is executing now, or another instance has locked the scheduled slot.</td></tr>
<tr><td>**Idle**</td>
<td>The automation is waiting for the next scheduled run.</td></tr>
<tr><td>**Suspended**</td>
<td>The connector is in a [backoff](https://docs.arc.cdata.com/26.4/self-hosted/en/connectors/connector-backoff.md) state after repeated failed runs, and the automation service is skipping it.</td></tr>
<tr><td>**Disabled**</td>
<td>The automation is turned off for the connector.</td></tr></tbody></table>

Last Run Time

The outcome of the most recent run.

<table><thead><tr><th>Field</th>
<th>Description</th></tr></thead>
<tbody><tr><td>**Date**</td>
<td>The scheduled time of the last run.</td></tr>
<tr><td>**Last Processed Start**</td>
<td>The time the connector actually started processing the last run. This can be slightly later than the scheduled time.</td></tr>
<tr><td>**Last Processed Result**</td>
<td>The outcome of the last run:
<ul><li>**Successful**: The run completed and processed data.</li>
<li>**No Data**: The run completed but there was nothing to process, such as a query that returned no rows.</li>
<li>**Failed**: The run did not complete.</li></ul></td></tr>
<tr><td>**Last Successful At**</td>
<td>The date and time of the most recent successful run. This field appears when the last run failed or returned no data, so you can see how long the connector has gone without a successful run.</td></tr></tbody></table>

Next Run Time

The **Date** field shows when the automation is scheduled to run next. It is blank when the automation is disabled.

View Details

The **Suspended** status, the **Failed** result, and the **No Data** result each include a **View Details** link that opens a dialog with the full message:

<ul><li>**Suspended**: Lists each instance that is in backoff, how many times it failed, and when the automation service resumes. See [Connector Backoff](https://docs.arc.cdata.com/26.4/self-hosted/en/connectors/connector-backoff.md) for how a connector exits this state.</li>
<li>**Failed**: Shows the error message from the last failed run.</li>
<li>**No Data**: Shows the message the connector reported, such as `0 rows returned`.</li></ul>

No Run Versus No Data

The card distinguishes a connector that has not run from one that ran and found nothing. If **Last Processed Result** is empty, the automation has not run yet, so check the **Next Run Time** and the schedule settings. If the result is **No Data**, the automation ran on schedule and the data source returned nothing, so check the source for new data.

Disabled Connectors

A disabled connector keeps its last run information, so you can still see when it last ran and what happened. Only the **Next Run Time** is cleared.

#### Performance

*Settings related to the allocation of resources to the connector.*

<table><thead><tr><th>Setting</th>
<th>Description</th></tr></thead>
<tbody><tr><td>**Max Workers**</td>
<td>The maximum number of worker threads consumed from the threadpool to process files on this connector. If set, this overrides the default setting on the [Performance Settings](https://docs.arc.cdata.com/26.4/self-hosted/en/getting-started/administration/settings/performance-settings.md) portion of the [Advanced Settings](https://docs.arc.cdata.com/26.4/self-hosted/en/getting-started/administration/settings/advanced-settings.md) page.</td></tr>
<tr><td>**Max Files**</td>
<td>The maximum number of files sent by each thread assigned to the connector. If set, this overrides the default setting on the [Performance Settings](https://docs.arc.cdata.com/26.4/self-hosted/en/getting-started/administration/settings/performance-settings.md) portion of the [Advanced Settings](https://docs.arc.cdata.com/26.4/self-hosted/en/getting-started/administration/settings/advanced-settings.md) page.</td></tr></tbody></table>

### Alerts Tab

*Settings related to configuring alerts.*

Before you can execute Service Level Agreements (SLAs), you need to set up email alerts for notifications. By default, Arc uses the global settings on the [Alerts](https://docs.arc.cdata.com/26.4/self-hosted/en/getting-started/administration/settings/alerts.md) tab. To use other settings for this connector, toggle **Override global setting** on.

By default, error alerts are enabled, which means that emails are sent whenever there is an error. To turn them off, uncheck the **Enable** checkbox.

Enter a **Subject** (mandatory). Check **Allow ArcScript in Subject** to use ArcScript in the **Subject** field. When you select this, the **ArcScript Editor** button appears (![arcscript editor button](https://docs.arc.cdata.com/26.4/images/rest_arcscript_editor.png)).

Optionally, enter a comma-separated list of **Recipient** emails.

### SLAs Tab

*Settings related to configuring Service Level Agreements (SLAs).*

SLAs enable you to configure the volume you expect connectors in your flow to send or receive, and to set the time frame in which you expect that volume to be met. CData Arc sends emails to warn the user when an SLA is not met, and marks the SLA as *At Risk*, which means that if the SLA is not met soon, it will be marked as *Violated*. This gives the user an opportunity to step in and determine the reasons the SLA is not being met, and to take appropriate actions. If the SLA is still not met at the end of the at-risk time period, the SLA is marked as violated, and the user is notified again.

SLA transitions to *At Risk* or *Violated* are also written to the [application log](https://docs.arc.cdata.com/26.4/self-hosted/en/getting-started/administration/activity.md#application-logs), which means that Application Performance Monitoring (APM) and log-ingestion tools can also alert on them.

To define an SLA, toggle **Expected Volume** on, then click the **Settings** tab.

![SLA Empty](https://docs.arc.cdata.com/26.4/images/sla_empty.png)
<ul><li>If your connector has separate send and receive actions, use the radio buttons to specify which direction the SLA pertains to.</li>
<li>In the **Expect at least** portion of the window:
<ul><li>Set the minimum number of transactions you expect to be processed (the volume)</li>
<li>Use the **Every** fields to specify the time frame</li>
<li>Indicate when the SLA should go into effect. If you choose **Starting on**, complete the date and time fields.</li>
<li>Check the boxes for the days of the week that you want the SLA to be in effect. Use the dropdown to choose **Everyday** if necessary.</li></ul></li>
<li>In the **Set status to 'At Risk'** portion of the window, specify when the SLA should be marked as at risk.
<ul><li>By default, notifications are not sent until an SLA is in violation. To change that, check **Send an 'At Risk' notification**.</li></ul></li></ul>

The following example shows an SLA configured for a connector that expects to receive 1000 files every day Monday-Friday. An at-risk notification is sent 1 hour before the end of the time period if the 1000 files have not been received.

![SLA Configuration Example](https://docs.arc.cdata.com/26.4/images/sla_defined.png)

> [!NOTE]
>
> You can turn off SLA alerts if necessary. This can be useful during maintenance windows. Click **Settings** on the navbar, then navigate to **Alerts > General Alerts**. Click the tablet and pencil icon to edit, and uncheck the **SLA Alerts** setting.

## Subfolder Headers

The Zip connector makes use of the Subfolder header for reading from and writing to compressed files. A Subfolder header is added any time there are subfolders in the zip structure.

> [!NOTE]
>
> When compressing files, the Subfolder header is only used when you set **Scheduled Send** on the Automation tab.

For example, this image from the **Message Details** page for a log entry shows the path to the subfolder in the **Other Headers** section.

![](https://mintcdn.com/cdata-arc/JuVWSaGlKX7avH_C/26.4/images/subfolder_header.png?fit=max\&auto=format\&n=JuVWSaGlKX7avH_C\&q=85\&s=a2f2efa64c1953c055577e0b3d97b892)

When decompressing a file:

* The message for each file that is in a subfolder in the compressed file contains a Subfolder header in its metadata.
* This header displays the path to the subfolder in the zip folder structure.
* This subfolder header is supported by other connectors that support a subfolder header in Send operations.

When compressing files, the connector looks for a Subfolder header on messages that it processes to determine where to place the files inside the compressed structure.

## Macros

Using macros in file naming strategies can enhance organizational efficiency and contextual
understanding of data. By incorporating macros into filenames, you can dynamically include
relevant information such as identifiers, timestamps, and header information, providing
valuable context to each file.

CData Arc supports these macros, which all use the following syntax: `%Macro%`.

<table><thead><tr><th>Macro</th><th>Description</th></tr></thead>
<tbody><tr><td>ConnectorID</td><td>Evaluates to the ConnectorID of the connector.</td></tr>
<tr><td>ConnectorName</td><td>Evaluates to the name of the connector. Enables you to include the connection name in file names or paths: for example, to tag backup files by which database connection produced them.</td></tr>
<tr><td>Ext</td><td>Evaluates to the file extension of the file currently being processed by the connector.</td></tr>
<tr><td>Filename</td><td>Evaluates to the filename (extension included) of the file currently being processed by the connector.</td></tr>
<tr><td>FilenameNoExt</td><td>Evaluates to the filename (without the extension) of the file currently being processed by the connector.</td></tr>
<tr><td>MessageId</td><td>Evaluates to the MessageId of the message being output by the connector.</td></tr>
<tr><td>RegexFilename:*pattern*</td><td>Applies a RegEx pattern to the filename of the file currently being processed by the connector.</td></tr>
<tr><td>Header:*headername*</td><td>Evaluates to the value of a targeted header (`headername`) on the current message being processed by the connector.</td></tr>
<tr><td>LongDate</td><td>Evaluates to the current datetime of the system in long-handed format (for example, Wednesday, January 24, 2024).</td></tr>
<tr><td>ShortDate</td><td>Evaluates to the current datetime of the system in a yyyy-MM-dd format (for example, 2024-01-24).</td></tr>
<tr><td>DateFormat:*format*</td><td>Evaluates to the current datetime of the system in the specified format (`format`). See [Sample Date Formats](https://docs.arc.cdata.com/26.4/self-hosted/en/scripting/value-formatters/date-formatters.md#date-formats-with-literal-characters) for the available datetime formats.</td></tr>
<tr><td>Vault:*vaultitem*</td><td>Evaluates to the value of the specified vault item.</td></tr></tbody></table>

### Examples

Some macros, such as %Ext% and %ShortDate%, do not require an argument, but others do. All
macros that take an argument use the following syntax: `%Macro:argument%`

Here are some examples of the macros that take an argument:

<ul><li>%Header:headername%: Where `headername` is the name of a header on a message.</li>
<li>%Header:mycustomheader% resolves to the value of the `mycustomheader` header set on the input message.</li>
<li>%Header:ponum% resolves to the value of the `ponum` header set on the input message.</li>
<li>%RegexFilename:pattern%: Where `pattern` is a regex pattern. For example, `%RegexFilename:^([\w][A-Za-z]+)%` matches and resolves to the first word in the filename and is case insensitive (`test_file.xml` resolves to `test`).</li>
<li>%Vault:vaultitem%: Where `vaultitem` is the name of an item in the [vault](https://docs.arc.cdata.com/26.4/self-hosted/en/getting-started/administration/settings/global-settings-vault.md). For example, `%Vault:companyname%` resolves to the value of the `companyname` item stored in the vault.</li>
<li>%DateFormat:format%: Where `format` is an accepted date format (see [Sample Date Formats](https://docs.arc.cdata.com/26.4/self-hosted/en/scripting/value-formatters/date-formatters.md#sample-date-formats) for details). For example, `%DateFormat:yyyy-MM-dd-HH-mm-ss-fff%` resolves to the date and timestamp on the file.</li></ul>

You can also create more sophisticated macros, as shown in the following examples:

<ul><li>Combining multiple macros in one filename: `%DateFormat:yyyy-MM-dd-HH-mm-ss-fff%%EXT%`</li>
<li>Including text outside of the macro: `MyFile_%DateFormat:yyyy-MM-dd-HH-mm-ss-fff%`</li>
<li>Including text within the macro: `%DateFormat:'DateProcessed-'yyyy-MM-dd_'TimeProcessed-'HH-mm-ss%`</li></ul>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.