ftp_move

Moves or renames a file on the FTP/SFTP server. Must be used inside an ftp_session block.

{% ftp_session host: "ftp.example.com", user: "myuser", password: "mypass" %}
  {% ftp_move from: "/inbox/data.csv", to: "/processed/data.csv" as result %}

  {% if result.ok %}
    {% log "File moved successfully" %}
  {% endif %}
{% endftp_session %}

Syntax

{% ftp_move from: "/source/path", to: "/destination/path" as result_variable %}

Parameters

Parameter
Required
Description

from

Yes

Current path of the file

to

Yes

New path for the file

Result Object

Property
Type
Description

ok

boolean

true if move succeeded

error

string/null

Error message if ok is false, null on success

from

string

Original file path

to

string

New file path

Example result:

Examples

Move file to archive folder:

Rename a file:

Process and archive files:

Move to dated archive folder:

Notes

  • Must be used inside an ftp_session block

  • Consumes 2 credits per operation

  • Destination directories are created automatically if they don't exist

  • Can be used to rename files by moving to same directory with different name

  • Works for both files and directories

Last updated