Skip to main content

Move File

Moves a file from one FTP location to another.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If ContinueOnError property is true, no error is caught when the project is executed even if Catch node is used.

Input

  • Session Id - The session identifier to use in FTP activity. The ID is the output of the Connect node.
  • FTP Source File Path - Source path of the FTP file to be moved.
  • FTP Destination File Path - Destination path of the FTP file.

How It Works

The Move File node relocates or renames a file on the remote FTP server:

  1. Session Validation: Verifies the session ID is valid and active
  2. Source Path Validation: Ensures source file path is not empty
  3. File Existence Check: Verifies the source file exists and is not a directory
  4. Destination Path Validation: Ensures destination path is not empty
  5. Destination Check: Verifies destination file doesn't already exist
  6. File Move/Rename: Performs the rename operation on the FTP server

Requirements

  • Active FTP session from the Connect node
  • Valid source file path that exists on the server
  • Source path must be a file, not a directory
  • Valid destination file path
  • Destination file must not already exist
  • Write permissions on both source and destination directories

Error Handling

Error CodeDescriptionCause
Core.FTP.MoveFile.ErrOnCreateConfig parse errorNode configuration is malformed
Core.FTP.MoveFile.OnMessageMessage parse errorInput message cannot be parsed
Core.FTP.MoveFile.ErrSessionSession id can not be emptySession ID input is empty
Core.FTP.MoveFile.ErrSessionInvalid sessionSession ID does not exist or has expired
Core.FTP.MoveFile.ErrPathSource File Path can not be emptySource path input is empty
Core.FTP.MoveFile.ErrPathSource File Path does not existSource file doesn't exist on server
Core.FTP.MoveFile.ErrPathSource File Path is not a fileSource path points to a directory
Core.FTP.MoveFile.ErrPathDestination File Path can not be emptyDestination path input is empty
Core.FTP.MoveFile.ErrorMove file errorFailed to move file - destination may exist or permission denied

Usage Examples

Example 1: Move File to Different Directory

// Input:
// Session ID: "ftp-session-123"
// FTP Source File Path: "/uploads/document.pdf"
// FTP Destination File Path: "/archive/document.pdf"
//
// Moves the file from uploads to archive directory

Example 2: Rename File in Same Directory

// Input:
// Session ID: "ftp-session-123"
// FTP Source File Path: "/data/temp.csv"
// FTP Destination File Path: "/data/processed-2024-01-15.csv"
//
// Renames the file with a timestamped name

Example 3: Move After Processing

// Workflow:
// 1. Download file from "/incoming/data.csv"
// 2. Process the file locally
// 3. If processing successful:
// - Move file to "/completed/data-2024-01-15.csv"
// 4. If processing failed:
// - Move file to "/failed/data-2024-01-15.csv"

Usage Notes

  • This is effectively a rename operation on the FTP server (same as UNIX mv command)
  • If destination file exists, the operation fails with an error
  • Moving across different file systems may not be supported on some FTP servers
  • Use forward slashes (/) in paths regardless of server OS
  • The operation is atomic on most FTP servers
  • Source file is validated to ensure it's not a directory
  • Both source and destination paths must be files, not directories
  • File metadata (permissions, timestamps) may be preserved or reset depending on server

Tips

  • Use File Exists node to check if destination already exists before moving
  • Implement error handling for cases where move fails due to existing destination
  • Combine with timestamp variables to create unique destination names
  • Use move operations to implement file processing workflows (incoming -> processing -> completed)
  • Consider the network overhead when moving large files (it's still a server-side operation)
  • Log move operations for audit trails
  • Use consistent naming conventions for archived files
  • Test move operations with non-critical files first
  • Implement retry logic for transient network failures