Adapter: FTP / FTPS
Transfer files over FTP or FTPS (explicit or implicit TLS).
Purpose
Download, upload, list, rename and delete files over FTP or FTPS: the FTP scheme of a Mirth File Reader or File Writer. Pick files up with the file pickup trigger.
Auth
usernameandpassword; leaveusernameempty to log in anonymously.secure:explicit(AUTH TLS, the default),implicit(TLS from the first byte) ornone. Plain FTP is accepted for Mirth parity with a warning on save: it sends the login and every file in clear text, so never use it for PHI.- FTPS verifies the server certificate and host name. A partner with a private CA puts it in
tlsCaPem;tlsMinVersionsets the lowest TLS version (1.2 by default). There is no option to turn verification off.
Settings
Auth is no selector; the secret settings below are the credentials. Dotted names are fields inside an object setting. Secret settings are encrypted at rest, never returned by a read, and shown masked in the console and in exports; their defaults are not shown.
| Setting | Type | Required | Default | Secret | Description |
|---|---|---|---|---|---|
host | string | Yes | No | FTP server hostname. | |
port | number | No | 21 | No | FTP port. |
username | string | No | No | User name (leave empty to log in anonymously). | |
password | string | No | Yes | Password. | |
secure | enum: explicit, implicit, none | No | explicit | No | explicit = FTPS with AUTH TLS, implicit = TLS from the first byte, none = plain FTP (clear text). |
tlsCaPem | string | No | Yes | PEM CA certificate(s) to verify the server against. See tlsCaMode. | |
tlsCaMode | enum: replace, add | No | No | Trust: replace = only this CA (default), add = the system CAs plus this CA. Needs tlsCaPem. | |
tlsClientCertPem | string | No | Yes | PEM client certificate, for servers that require mutual TLS. Set with tlsClientKeyPem. | |
tlsClientKeyPem | string | No | Yes | PEM private key for the client certificate (encrypted at rest). | |
tlsClientPfx | string | No | Yes | Client certificate and key as a base64 PKCS#12 (.p12 / .pfx) bundle, instead of the PEM pair. | |
tlsClientPassphrase | string | No | Yes | Passphrase of the PKCS#12 bundle. | |
tlsMinVersion | enum: TLSv1.2, TLSv1.3 | No | No | Lowest TLS version to accept (default TLSv1.2). | |
passive | boolean | No | true | No | Passive mode (the client always connects passively). |
timeout | number | No | 30000 | No | Connection and command timeout in milliseconds. |
maxFileBytes | number | No | 52428800 | No | Largest file a read loads into memory (bytes, counted as they arrive). |
uploadMode | enum: temp-rename, direct | No | temp-rename | No | temp-rename writes a hidden .part file then renames it; direct writes the final name. |
writeMode | enum: overwrite, append, error-if-exists | No | overwrite | No | overwrite replaces an existing file; append adds to it (written directly); error-if-exists fails the step. |
createDirs | boolean | No | false | No | Create the parent directory before writing. |
Actions
A trailing ? marks an optional step parameter. A message can supply only the keys in the last column; everything else comes from the step.
| Action | What it does | Step parameters | Keys a message may supply |
|---|---|---|---|
download | Read a file from the FTP server. | remotePath, encoding? | None |
upload | Write a file to the FTP server. | remotePath, filenamePattern?, content? | content |
list | List files in a directory. | remotePath? | None |
delete | Delete a file. | remotePath | None |
rename | Move (rename) a file. | fromPath, toPath | None |
Minimal example
The smallest profile the engine accepts: the required settings only, with synthetic values. Create it with POST /api/adapter-profiles, then test it with POST /api/adapter-profiles/{id}/test.
{
"name": "FTP / FTPS (example)",
"adapterType": "ftp",
"config": {
"host": "example-host"
}
}Limits
- The host goes through the SSRF rules: the cloud metadata server is always refused, and a private address needs
SSRF_ALLOWLIST. The engine connects to the address it checked. - Passive mode only, and the data connection always goes to the control connection's host (a PASV reply naming another host is refused).
passive: falseis accepted with a warning. - A server without MLSD gets each file's time from MDTM; a server with neither reports time 0, so the pickup's file-age check passes at once and the size check alone guards a file still being written.
- Writes use a hidden
.partfile and a rename by default; append uses APPE. - A read stops once more than
maxFileByteshave arrived, whatever size the server lists. - One connection per call, closed afterwards.