> ## 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.

# File Connector

> The File connector pulls files from external directories into the flow and pushes files from the flow into external directories.

The File connector can:

* Pull files from external directories into the CData Arc flow
* Push files from the Arc flow into external directories

## Key Capabilities

* Local and network file system integration with UNC path support
* Configurable authentication for protected network locations (.NET edition only)
* Advanced filtering with glob patterns and recursive directory support
* Temporary file handling with staging and rename operations for reliable transfers
* Optional caching to ensure only new or updated files are downloaded

## Overview

Each File connector is configured with a path on disk that determines what folder it reads files from or writes files to. This can be a local file path or a UNC path to access other file locations on the network.

When a File connector receives a file from the configured path, it passes the received file off to the next connector in the Arc flow without modifying the file. In this way, File connectors can be used to poll an external folder location for files to pull into the Arc flow.

When a file in the Arc flow is processed by a File connector, that file is written to the folder at the configured path. In this way, File connectors can be used to drop off processed files at a location external to the application.

File connectors can be configured with username/password credentials to provide access to external filepaths that otherwise would not be accessible to the application. This allows Arc to pull files from protected folder locations without needing to grant the entire application access to the protected location.

The path configured in the File connector can be dynamically populated using macros. For more information, see the [Macros](#macros) section.

## Connector Configuration

This section contains all of the configurable connector properties.

### Settings Tab

#### Connector Settings

*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. |
| **Path** | The external filepath where the connector pulls files from or pushes files to. The path can include macros for dynamic evaluation, as described in [Macros](#macros). |

#### Receive

*Settings related to pulling files from the external filepath.*

| Setting | Description |
| - | - |
| **File Mask** | A glob pattern for filtering files that should be pulled from the configured path. Only files matching the filemask are pulled. This setting can be combined with **Receive Filter** on the Advanced tab to specify multiple filters. |
| **Delete files (after received)** | Whether to remove files from the external path after they are pulled into the Arc flow. When **Defer received-file finalization** is enabled, files are removed only after successful finalization. |
| **Defer received-file finalization** | Keep received files pending until a downstream [Finalize](https://docs.arc.cdata.com/26.4/self-hosted/en/connectors/finalize.md) connector completes them. Pending files are excluded from receiving again. **Receive Pending Timeout (minutes)** on the **Automation** tab releases them for another receive without deleting the source. This setting is disabled by default and does not affect sending files. For more information, see [Deferred Finalization](#deferred-finalization). |

#### Authentication

| Setting | Description |
| - | - |
| **Username** | The Windows user account that is used to access the files. If this is not specified, the connector uses the current user account. |
| **Password** | The password for the specified user account. |
| **Domain** | The domain for the Windows user account. This can be empty if the specified user is a local user account. |

#### Caching

*Settings related to caching and comparing files between multiple downloads.*

| Setting | Description |
| - | - |
| **File Size Comparison** | Check this to keep a record of downloaded file names and sizes. Previously downloaded files are skipped unless the file size is different than the last download. |
| **Timestamp Comparison** | Check this to keep a record of downloaded file names and last-modified timestamps. Previously downloaded files are skipped unless the timestamp is different than the last download. |

> [!NOTE]
>
> Arc automatically cleans up the resource cache. This process runs in the background during every receive cycle and removes stale cache entries for files that are no longer present on the remote server. This keeps the cache size manageable without requiring any manual action. By default, files are retained for 30 days, but you can use the `ResourceCacheRetentionDays` setting in the **Other Settings** field on the **Advanced** tab to adjust it to fit your environment. For example, `ResourceCacheRetentionDays=15` retains files for 15 days before removing them. When you enable caching, the file names are case-insensitive. For example, the connector cannot distinguish between `TEST.TXT` and `test.txt`.

### Advanced Tab

#### Advanced Settings

*Settings not included in the previous categories.*

| Setting | Description |
| - | - |
| **Max Receive Files** | The maximum number of files that are pulled in a single receive interval. If this is not a positive integer, no limit is applied. |
| **Overwrite Option** | Specifies how the connector should handle the case when it attempts to write a file to the external path and that file already exists. The connector can *rename* the current file to a unique filename, *overwrite* the existing file, *append* the current file to the existing file, *skip* the operation without error, or *stop* the operation and throw an error. |
| **Receiving Delay** | The amount of time (in seconds) that the connector waits before receiving files from the remote path. |
| **Recurse** | Set this to true to download files in all subfolders of the target remote path. The directories are preserved for the received files. |
| **Temp Send Path** | A directory to use as a staging folder before moving the file to its configured destination path. |
| **Temp Send Prefix** | If specified, the connector uploads the file with the temporary prefix, then renames the file to its original filename after the operation is complete. |
| **Temp Send Extension** | If specified, the connector uploads the file with the temporary extension, then renames the file to its original filename and extension after the operation is complete. |
| **Minimum File Size** | The minimum file size to process, in bytes. If a file being uploaded is smaller than the specified size, it is finalized as **Skipped**. For files being downloaded, the connector adds a transaction log entry indicating that the file was skipped because of its size. |
| **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). |
| **Receive Filter** | A glob pattern filter to determine which files should be downloaded from the remote storage (e.g. \*.txt). Use negative patterns to indicate files that should *not* be downloaded (for example, -\*.tmp). Use this setting when you need multiple **File Mask** patterns. Separate multiple patterns by commas; later filters take priority except when an exact match is found. |
| **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. |

#### 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>

#### 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.*

| Setting | Description |
| - | - |
| **Send** | A toggle that instructs the connector to automatically send files when they are ready. |
| **Retry Interval** | The interval the connector waits before retrying a failed send. |
| **Max Attempts** | The number of attempts the connector makes to send the message. Setting this value to *1* instructs the connector to only make the initial send attempt without retrying. The connector waits the duration specified by **Retry Interval** between each attempt. |
| **Receive** | A toggle that instructs the connector to automatically process files when they are ready and send them to the **Transactions** tab. |
| **Interval** | The interval at which the connector processes all pending files and sends them to the **Transactions** tab. |
| **Minutes Past the Hour** | The minutes offset for an hourly schedule. Only applicable when the interval setting above is set to *Hourly*. For example, if this value is set to 5, the automation service processes files at 1:05, 2:05, 3:05, etc. |
| **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 processing files. 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. |
| **Receive Pending Timeout (minutes)** | The number of minutes a received file stays pending while it waits for a downstream [Finalize](https://docs.arc.cdata.com/26.4/self-hosted/en/connectors/finalize.md) connector to complete it. When the timeout elapses, the message is marked with a Pending Timeout error, the source file is not deleted, and the file is released so that it can be received again. The default is 10 minutes. Set this to 0 to keep files pending indefinitely. |

#### 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.

## Establishing a Connection

File connectors must have the appropriate permissions to read/write from the configured path. Permissions issues are primarily a concern when the configured path is a UNC path to another server on the network, but can also arise when pushing or pulling files from a protected folder on the local disk.

If the user running Arc does not have permission to access the path, set the **Username**, **Password**, and **Domain** fields in the [Authentication](#authentication) section of the **Settings** tab to a specific user with the appropriate permissions.

## Sending and Receiving Files

### Sending Files

The File connector sends files from the **Transactions** tab to the external folder specified in the configured path. Files are automatically sent if **Send** is enabled on the [Automation](#automation-settings) tab.

### Receiving Files

The File connector receives files from the external folder specified in the configured path and places them in the connector's **Transactions** tab. If the File connector is connected to another connector in the flow, the file does not remain in this folder and is instead passed along to the next connected connector.

The connector automatically polls the external folder for files if **Receive** is enabled on the [Automation](#automation-settings) tab.

The connector only pulls files that match the specified **File Mask**. If **Enable Timestamp Comparison** or **Enable File Size Comparison** is enabled, the connector caches file names pulled from the remote path and only receives files that are new or have been modified since they were last received.

When multiple eligible files are available in a single receive operation, the connector processes them in ascending order by last-modified timestamp, so older files enter the flow first. Files with identical timestamps are processed in a consistent, predictable order.

### Deferred Finalization

By default, the connector completes a file as soon as it receives it, and any configured cleanup, such as **Delete files (after received)**, happens immediately. If a later step in the flow fails, the source file is already gone.

When **Defer received-file finalization** is enabled, the connector instead holds each received file in a pending state and waits for a downstream [Finalize](https://docs.arc.cdata.com/26.4/self-hosted/en/connectors/finalize.md) connector to confirm that the flow succeeded. This is the recommended way to use **Delete files (after received)** when you need to keep the source file until processing is complete.

To use deferred finalization:

1. Enable **Defer received-file finalization** on the File connector that receives the files.
2. Add a Finalize connector at the end of the success path of the flow.

While a file is pending:

* The connector does not receive the file again.
* If the file reaches the Finalize connector, the connector completes the file and performs the configured cleanup.
* If the file does not reach the Finalize connector before **Receive Pending Timeout (minutes)** elapses, the message is marked with a Pending Timeout error and the file is released so that it can be received again. The source file is not deleted. The connector records a **Send Failure: Pending Timeout** error notification.
* If the source file changes after it was received, the connector does not delete it, even when the file is finalized.

Deferred finalization applies only to receiving files. It does not change how the connector sends files.

### Subfolder Headers

If **Recurse Subdirectories** is set to **True**, when receiving a file:

* The message for the received file contains a Subfolder header in its metadata.
* This header contains the subfolder, relative to the configured path, that the file was received from.
* This subfolder header is supported by other connectors that support a Subfolder header in Send operations.

When sending files, if a Subfolder header is present on the message that is sent to the configured path in the File connector:

* The file is placed in the subfolder (relative to the path setting in the File connector) that is specified in the subfolder header.
* The subfolder is created if permissions are available.

## 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.