File

The File Connector supports reading and writing files locally on the file system, via SMB (Server Message Block), FTP, and SFTP.

Connection Settings

Communication Protocol

Specifies the communication protocol used to access the files. The following options are supported.

Option Description
File Protocol Used for local directory access. Local in this context means on the same machine the Intelligence Hub is running on.
SMB Used to access shared network directories.
FTP Access files on an FTP server.
SFTP Access files over

Communication Protocol: SMB

The following connection settings are available for the SMB protocol.

Setting Description
Share Specifies the server and share name of the access shared network directory.

Ex. \ServerName\ShareName
Domain Specifies the domain of the server used to access the shared network directory.
Username Username required to authenticate with the share. Leave this blank for anonymous access.
Password Password required to authenticate with the share. Leave this blank for anonymous access.

Communication Protocol: FTP

The following connection settings are available for the FTP protocol.

Setting Description
Server Type In most cases this should be set to Unix. In some cases, Windows specific FTP servers may need the Windows option selected.
Use Passive Mode In most cases passive mode should be used. Active mode requires the FTP server to connect back to the FTP Client, and is more difficult to configure securely.
Host Specifies the hostname of the FTP server.
Port Specifies the port of the FTP server.
Username Username required to authenticate with the share. Leave this blank for anonymous access.
Password Password required to authenticate with the share. Leave this blank for anonymous access.

Communication Protocol: SFTP

The following connection settings are available for the SFTP protocol.

Setting Description
Host Specifies the hostname of the SFTP server.
Port Specifies the port of the SFTP server.
Username Username required to authenticate with the server.
Password Password required to authenticate with the server.

Common Connection Settings

The following settings are applicable to all protocols.

Setting Description
File Directory Specifies the root directory for file processing.
Processed File Directory Specifies the directory where files are moved to after processing successfully. This is only used by inputs that enable “Process File”.
Error Directory Specifies the directory where files are moved to after processing unsuccessfully. This is only used by inputs that enable “Process File”.

Browse

Input and Output Browsing

After the connection has been configured, the browse button can be used to navigate through the file system and create an Input or Output for any file or directory.

Input Settings

File Input Type

The File input type returns the content of a single file and has the following settings

File Name

The file name to read. This can be the full name of a single file or a regular expression. As an example, (.+) matches any file in the directory.

Use the References panel on the left to explore and drag-and-drop references to other inputs.

File Encoding

The character set used to decode the contents of the file.

Process File

When enabled, the file is moved to the connection’s processed directory after being read.

Include Metadata

Include metadata in the read, including file name, relative file path, creation and update times (if available), and file size.

Directory Input Type

The Directory input returns a list of the contents of a directory and has the following settings

Recursive

Designates whether the directory input should recursively explore sub directories.

Common settings

Relative Path

The relative path of the starting directory in regards to the connection level File Directory setting.

Time Filter

The time filter can be set to filter on either creation or update time, and will cause the input to return only files or directories which have been either created or updated after a provided ISO 8601 time.

Note: Time filter is dependent on both the protocol and server operating system. Protocols such as FTP and SFTP which don’t support creation time will not be able to be filtered on creation.

Output Settings

File Name

Specifies the name of the file to write to. This includes the file extension and directories. The file path can include dynamic outputs (e.g., /{{this.site}}/file.bin)

Relative Path

The relative path of the starting directory in regard to the connection level File Directory setting.

Payload Reference

When working with complex payloads, this setting uses dynamic outputs to specify the attribute that contains the file payload (e.g. {{this.filePayload}}).

Note: If left blank, the file connector will write the entire payload out to a file.

Base64 Decoding

When enabled, payloads are base64 decoded before being output as a file. This is used in when receiving Base64 encoded file payloads over other connections such as REST or MQTT.