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:
- Session Validation: Verifies the session ID is valid and active
- Path Validation: Ensures the file path is not empty
- File Existence Check: Verifies the file exists on the server
- 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 Code | Description | Cause |
|---|---|---|
| Core.FTP.RemoveFile.ErrOnCreate | Config parse error | Node configuration is malformed |
| Core.FTP.RemoveFile.OnMessage | Message parse error | Input message cannot be parsed |
| Core.FTP.RemoveFile.ErrSession | Session id can not be empty | Session ID input is empty |
| Core.FTP.RemoveFile.ErrSession | Invalid session | Session ID does not exist or has expired |
| Core.FTP.RemoveFile.ErrPath | Path can not be empty | File path input is empty |
| Core.FTP.RemoveFile.ErrPath | Path does not exist | File does not exist at specified path |
| Core.FTP.RemoveFile.Error | File deletion error | Failed 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
Related Nodes
- Connect - Establish FTP connection
- File Exists - Check if file exists before deletion
- Download - Download file before deleting
- List Directory - Find files to delete
- Move File - Move file instead of deleting
- Disconnect - Close the FTP session