Skip to main content

Delete File

Deletes a file from FTP server

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 ID of the FTP session. The ID is the output of the Connect node.
  • Ftp File Path - The path of the file in FTP server to delete

How It Works

The Delete File node removes a file from the remote FTP server:

  1. Session Validation: Verifies the session ID is valid and active
  2. Path Validation: Ensures the file path is not empty
  3. File Existence Check: Verifies the file exists on the server
  4. File Deletion: Removes the file from the FTP server

Requirements

  • Active FTP session from the Connect node
  • Valid file path on the FTP server
  • Delete permissions on the file
  • File must exist at the specified path

Error Handling

Error CodeDescriptionCause
Core.FTP.RemoveFile.ErrOnCreateConfig parse errorNode configuration is malformed
Core.FTP.RemoveFile.OnMessageMessage parse errorInput message cannot be parsed
Core.FTP.RemoveFile.ErrSessionSession id can not be emptySession ID input is empty
Core.FTP.RemoveFile.ErrSessionInvalid sessionSession ID does not exist or has expired
Core.FTP.RemoveFile.ErrPathPath can not be emptyFile path input is empty
Core.FTP.RemoveFile.ErrPathPath does not existFile does not exist at specified path
Core.FTP.RemoveFile.ErrorFile deletion errorFailed to delete file (details in error message)

Usage Examples

Example 1: Delete a Specific File

// Input:
// Session ID: "ftp-session-123"
// FTP File Path: "/uploads/report.pdf"
//
// Permanently removes the file from the server

Example 2: Cleanup After Download

// Workflow:
// 1. Download file "/incoming/data.csv"
// 2. Process the file locally
// 3. Delete file "/incoming/data.csv" from server
//
// This prevents reprocessing the same file

Example 3: Delete Multiple Files in Loop

// Workflow:
// 1. List files in directory "/temp"
// 2. For each file older than 7 days:
// - Delete the file
//
// Use ForEach loop to iterate over file list

Usage Notes

  • The file is permanently deleted and cannot be recovered
  • The node checks if the file exists before attempting deletion
  • If the file doesn't exist, an error is thrown
  • Use forward slashes (/) in file paths regardless of server OS
  • Ensure you have proper permissions to delete the file
  • Some FTP servers may move deleted files to trash instead of permanent deletion
  • File deletion is immediate and not transactional

Tips

  • Always verify the file path before deletion to avoid data loss
  • Use File Exists node to check before deleting if file might not exist
  • Enable Continue On Error if file non-existence should not halt workflow
  • Keep audit logs of deleted files for compliance purposes
  • Use List Directory with filters to identify files to delete
  • Test deletion logic with non-critical files first
  • Consider archiving important files before deletion
  • Use conditional logic to implement retention policies