Upload
Uploads a file to an 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 session id to be used for connecting to the FTP server. The ID is the output of the Connect node.
- FTP File Path - The path of the file on the FTP server to upload.
- Local File Path - The path of the file on the local machine to be uploaded.
How It Works
The Upload node transfers a file from the local machine to the remote FTP server:
- Session Validation: Verifies the session ID is valid and active
- Path Validation: Ensures both local and FTP paths are provided
- Local File Read: Reads the file from the local file system
- File Upload: Transfers the file data to the FTP server
- Server Storage: Writes the file to the specified path on the server
Note: For FTPS, large files are uploaded in 64KB chunks with retry logic (3 retries per chunk).
Requirements
- Active FTP session from the Connect node
- Valid local file path with read permissions
- Local file must exist on the machine
- Valid FTP destination path
- Write permissions on the remote directory
- Sufficient disk space on the FTP server
- Network connectivity with adequate bandwidth for file size
Error Handling
| Error Code | Description | Cause |
|---|---|---|
| Core.FTP.Upload.ErrOnCreate | Config parse error | Node configuration is malformed |
| Core.FTP.Upload.OnMessage | Message parse error | Input message cannot be parsed |
| Core.FTP.Upload.ErrSession | Session id can not be empty | Session ID input is empty |
| Core.FTP.Upload.ErrSession | Invalid session | Session ID does not exist or has expired |
| Core.FTP.Upload.ErrPath | FTP path can not be empty | FTP file path input is empty |
| Core.FTP.Upload.ErrPath | Local path can not be empty | Local file path input is empty |
| Core.FTP.Upload.Error | Upload error | File upload failed (details in error message) |
Usage Examples
Example 1: Upload a Single File
// Input:
// Session ID: "ftp-session-123"
// Local File Path: "C:/Documents/report.pdf"
// FTP File Path: "/uploads/report.pdf"
//
// Uploads the file from local machine to FTP server
Example 2: Upload with Dynamic Naming
// Using variables for flexible uploads
// Session ID: "ftp-session-123"
// Local File Path: "C:/Reports/" + msg.filename
// FTP File Path: "/daily-reports/" + msg.date + "/" + msg.filename
//
// Allows uploading with dynamic paths based on workflow data
Example 3: Batch Upload in Loop
// Workflow:
// 1. Get list of files from local directory
// 2. For each file in list:
// - Upload file to "/uploads/" + filename
// - Check if upload successful
// - Delete local file after successful upload
//
// Use ForEach to iterate over file list
Usage Notes
- If a file with the same name exists on the server, it will be overwritten without warning
- For FTP and SFTP: Files are uploaded as a single operation
- For FTPS: Large files are uploaded in 64KB chunks with automatic retry (up to 3 attempts per chunk)
- FTPS creates a temporary .part file during upload, which is renamed on completion
- File upload is performed in memory, ensure sufficient RAM for large files
- Use forward slashes (/) in FTP paths
- Windows local paths can use backslashes () or forward slashes (/)
- Network interruptions during upload may result in partial files on the server
Tips
- Check if the file exists on server using File Exists before uploading to avoid overwrites
- Implement error handling for network failures during large uploads
- Monitor available disk space on the FTP server before uploading
- Use unique file names or timestamps to prevent overwriting important files
- Create destination directories before upload using Create Directory node
- Log successful uploads for audit trails
- Consider upload bandwidth and time for very large files
- Validate file integrity after upload (compare sizes)
- Use temporary upload directories, then move files to final location
- Delete local files only after confirming successful upload
- For FTPS, the chunked upload with retry provides better reliability for large files
Related Nodes
- Connect - Establish FTP connection
- Download - Download files from FTP server
- File Exists - Check if file exists before upload
- Create Directory - Create destination directory
- List Directory - Verify upload completed
- Move File - Move file after upload
- Delete File - Delete file if upload needs retry
- Disconnect - Close the FTP session