Skip to content
Reference

Adapter: FTP / FTPS

Transfer files over FTP or FTPS (explicit or implicit TLS).

On this page

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

  • username and password; leave username empty to log in anonymously.
  • secure: explicit (AUTH TLS, the default), implicit (TLS from the first byte) or none. 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; tlsMinVersion sets 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.

SettingTypeRequiredDefaultSecretDescription
hoststringYesNoFTP server hostname.
portnumberNo21NoFTP port.
usernamestringNoNoUser name (leave empty to log in anonymously).
passwordstringNoYesPassword.
secureenum: explicit, implicit, noneNoexplicitNoexplicit = FTPS with AUTH TLS, implicit = TLS from the first byte, none = plain FTP (clear text).
tlsCaPemstringNoYesPEM CA certificate(s) to verify the server against. See tlsCaMode.
tlsCaModeenum: replace, addNoNoTrust: replace = only this CA (default), add = the system CAs plus this CA. Needs tlsCaPem.
tlsClientCertPemstringNoYesPEM client certificate, for servers that require mutual TLS. Set with tlsClientKeyPem.
tlsClientKeyPemstringNoYesPEM private key for the client certificate (encrypted at rest).
tlsClientPfxstringNoYesClient certificate and key as a base64 PKCS#12 (.p12 / .pfx) bundle, instead of the PEM pair.
tlsClientPassphrasestringNoYesPassphrase of the PKCS#12 bundle.
tlsMinVersionenum: TLSv1.2, TLSv1.3NoNoLowest TLS version to accept (default TLSv1.2).
passivebooleanNotrueNoPassive mode (the client always connects passively).
timeoutnumberNo30000NoConnection and command timeout in milliseconds.
maxFileBytesnumberNo52428800NoLargest file a read loads into memory (bytes, counted as they arrive).
uploadModeenum: temp-rename, directNotemp-renameNotemp-rename writes a hidden .part file then renames it; direct writes the final name.
writeModeenum: overwrite, append, error-if-existsNooverwriteNooverwrite replaces an existing file; append adds to it (written directly); error-if-exists fails the step.
createDirsbooleanNofalseNoCreate 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.

ActionWhat it doesStep parametersKeys a message may supply
downloadRead a file from the FTP server.remotePath, encoding?None
uploadWrite a file to the FTP server.remotePath, filenamePattern?, content?content
listList files in a directory.remotePath?None
deleteDelete a file.remotePathNone
renameMove (rename) a file.fromPath, toPathNone

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.

json
{
  "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: false is 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 .part file and a rename by default; append uses APPE.
  • A read stops once more than maxFileBytes have arrived, whatever size the server lists.
  • One connection per call, closed afterwards.

Reference