File Connectors

Updated Mar 28, 2026
DataMagik Automate

File Connectors Guide

Connect to remote file systems via FTP, SFTP, and FTPS. Browse files, automate file processing with trigger rules, and integrate with the Script Engine.

Table of Contents

  1. Overview
  2. Connector Types
  3. Creating an FTP Connector
  4. Creating a Filesystem Connector
  5. File Browser
  6. File Operations
  7. File Trigger Rules
  8. Polling Configuration
  9. Audit Logging
  10. Best Practices

1. Overview

File Connectors enable DataMagik to integrate with external file systems for automated file processing, transfer, and monitoring. Two connector types are available:

  • FTP Connectors — Connect to remote servers via FTP, SFTP, or FTPS protocols
  • Filesystem Connectors — Access local or network file systems through on-premise connector agents

Key Features:

  • Multiple Protocols — FTP, SFTP (SSH), and FTPS (TLS) support
  • File Browser — Visual file browser for navigating and managing files
  • Trigger Rules — Automatically process files matching patterns with scripts
  • Polling — Interval-based or cron-scheduled file monitoring
  • Full Audit Trail — Every file operation is logged with user, timing, and status
  • Duplicate Prevention — Tracks processed files to avoid reprocessing

2. Connector Types

FTP Connectors

Connect to remote file servers using standard file transfer protocols:

ProtocolDefault PortDescription
FTP21Standard File Transfer Protocol
SFTP22SSH File Transfer Protocol (encrypted)
FTPS21FTP over SSL/TLS (encrypted)

Authentication Methods:

  • Username and password
  • SSH private key with optional passphrase (SFTP only)
  • SFTP host key verification (Trust-On-First-Use)

Filesystem Connectors

Access local or network-mounted file systems through a DataMagik connector agent:

  • Linked to a specific connector site and agent
  • Operates within a configured base path
  • Can be set to read-only mode to prevent writes and deletes
  • Optional printing enabled flag for print job file output

3. Creating an FTP Connector

Step 1: Navigate to File Connectors

Go to Connectors → File Connectors in the main menu.

Step 2: Click "Add FTP Connector"

Step 3: Configure Connection Settings

FieldDescription
NameFriendly name for the connector
TypeFTP, SFTP, or FTPS
HostServer hostname or IP address
PortServer port (defaults based on type)
UsernameLogin username
PasswordLogin password (stored encrypted)
Base PathRoot directory for file operations
Passive ModeUse passive FTP mode (recommended for firewalls)

For SFTP Connections

FieldDescription
Private KeySSH private key for key-based authentication
Private Key PassphrasePassphrase for the private key (if encrypted)

File Restrictions

FieldDescription
Allowed ExtensionsWhitelist of file types (e.g., .csv, .pdf, .xml)
Max File SizeMaximum file size limit (default: 10 MB)

Step 4: Test Connection

Click Test Connection to verify the connector can reach the server. Fix any issues before saving.

4. Creating a Filesystem Connector

Filesystem connectors use your on-premise connector agent to access local file systems.

Configuration

FieldDescription
NameFriendly name
SiteConnector site with an active agent
ConnectorSpecific agent instance
Base PathRoot directory path on the local machine
Read OnlyPrevent write and delete operations
Allowed ExtensionsFile type whitelist
Max File SizeSize limit for uploads

5. File Browser

The File Browser provides a visual interface for navigating and managing files across all connector types.

Accessing the File Browser

Navigate to Connectors → File Browser in the main menu.

Features

  • Browse — Navigate directories across all connected file systems
  • Upload — Upload files via multipart upload
  • Download — Stream file downloads
  • Preview — Read and preview file content
  • Create Folders — Create new directories
  • Move/Rename — Move or rename files and folders
  • Delete — Remove files (with confirmation)

6. File Operations

All file operations are available via API for both FTP and filesystem connectors:

OperationDescription
ListList directory contents with metadata (size, modified date)
ReadRead file content with SHA256 hash verification
WriteCreate or overwrite files (with size validation)
DeleteRemove files
MoveMove or rename files
CopyDuplicate files
MkdirCreate new directories

7. File Trigger Rules

Trigger rules automatically process files that match a pattern by executing a DataMagik script.

Creating a Trigger Rule

FieldDescription
NameRule display name
ConnectorFTP or filesystem connector to monitor
File PatternGlob pattern to match (e.g., invoice_*.pdf, *.csv)
ScriptScript Engine script to execute when files match
Post-Process ActionWhat to do with the file after processing
PriorityExecution order (higher runs first)
EnabledToggle the rule on/off

Post-Process Actions

ActionDescription
LeaveFile remains in original location
DeleteFile is automatically removed after processing
MoveFile is relocated to a specified archive path

How Triggers Work

  1. Polling detects a file matching the trigger pattern
  2. File metadata is captured (path, size, hash)
  3. The associated script executes with the file context
  4. The post-process action is applied (leave, delete, or move)
  5. The file is recorded as processed to prevent reprocessing

Execution History

View trigger execution history to monitor which files were processed, when, and whether the script succeeded or failed.

8. Polling Configuration

Configure how frequently connectors check for new files.

Polling Settings

SettingDescriptionDefault
Polling EnabledActivate or deactivate file monitoringOff
Polling IntervalMinutes between polling cycles60 minutes
Cron ScheduleCron expression for complex schedulesOptional

Cron Schedule Examples

ExpressionDescription
*/15 * * * *Every 15 minutes
0 9 * * MON-FRI9 AM on weekdays
0 */2 * * *Every 2 hours
0 6,18 * * *6 AM and 6 PM daily

Note: If both an interval and cron schedule are set, the cron schedule takes precedence.

Failure Handling

  • Consecutive failures are tracked per polling job
  • Retry backoff is applied after repeated failures
  • Error details are recorded for troubleshooting

9. Audit Logging

Every file operation is recorded in the audit log with comprehensive details:

FieldDescription
OperationType of operation (list, read, write, delete, move, copy, mkdir)
Source/DestinationFile paths involved
File Size & HashSHA256 hash before and after operation
Triggered BySource: script, API, UI, schedule, or poll
User & IPWho performed the operation and from where
StatusSuccess, failed, or partial
DurationOperation time in milliseconds

Access audit logs from Connectors → File Connectors to review file operation history.

10. Best Practices

Connection Setup

  • Use SFTP when possible — Provides encrypted file transfer
  • Use key-based auth for SFTP — More secure than passwords
  • Enable passive mode for FTP — Works better through firewalls
  • Test connections after setup — Verify connectivity before creating trigger rules

File Processing

  • Use specific file patternsinvoice_*.csv is better than *.*
  • Use Move post-process action — Archive processed files rather than deleting
  • Set allowed extensions — Restrict file types for security
  • Set max file size — Prevent oversized files from consuming resources

Polling

  • Use cron for business-hours processing — Avoid unnecessary polling overnight
  • Don't poll too frequently — Match interval to how often new files appear
  • Monitor execution history — Check for failed triggers regularly

Security

  • Credentials are encrypted at rest — Passwords and private keys are stored securely
  • Use read-only mode — For filesystem connectors that should only read, never write
  • Review audit logs — Monitor for unexpected file operations
Was this page helpful?