ftp_session

Establishes a connection to an FTP or SFTP server. All FTP operations (ftp_list, ftp_download, ftp_upload, ftp_move, ftp_delete) must be placed inside this block.

{% ftp_session host: "ftp.example.com", user: "username", password: "password" %}
  {% ftp_list path: "/data" as files %}
  {% log files %}
{% endftp_session %}

Syntax

{% ftp_session host: "hostname", user: "username", password: "password" %}
  ... FTP operations ...
{% endftp_session %}

Parameters

Parameter
Required
Default
Description

host

Yes

-

FTP server hostname

user

Yes

-

Username for authentication

password

Yes

-

Password for authentication

port

No

21 (FTP) / 22 (SFTP)

Server port

sftp

No

false

Set to true for SFTP connection

Examples

Standard FTP connection:

{% ftp_session host: "ftp.example.com", user: "myuser", password: "mypass" %}
  {% ftp_list path: "/" as result %}
  {% log result.files %}
{% endftp_session %}

SFTP connection:

Custom port:

Using variables for credentials:

Notes

  • Connection is automatically closed when the block ends

  • All FTP operation tags must be nested inside ftp_session

  • Supports both FTP (port 21) and SFTP (port 22)

  • Connection timeout is 5 minutes by default

  • Each FTP operation inside the session consumes 2 credits

Last updated