Overview
This node enables file operations over FTP, FTPS (FTP with TLS), and SFTP protocols. It supports secure connections using TLS for FTP and FTPS, as well as SSH-based SFTP connections. The node can perform common file management tasks such as listing files, downloading, uploading, deleting, and renaming files or directories on a remote server.
Typical use cases include:
- Automating file transfers to/from a secure FTP/SFTP server.
- Uploading generated reports or data files to a remote location.
- Downloading files from a remote server for further processing.
- Managing remote directory contents by listing or cleaning up files.
- Renaming or deleting files/folders remotely as part of workflow automation.
For example, you could use this node to upload a CSV report generated in your workflow to a secure FTPS server, or download log files from an SFTP server for analysis.
Properties
| Name | Meaning |
|---|---|
| Path | The remote path on the FTP/FTPS/SFTP server where the operation will be performed. |
| Binary Property Name | The name of the binary property in which to store the downloaded file or from which to read the upload file. Applicable for download and upload operations. Default is "data". |
| Binary Data | Boolean flag indicating whether to upload binary data (true) or plain text content (false). Only relevant for the upload operation. |
| File Content | The textual content of the file to upload when not uploading binary data. Only shown if Binary Data is false and operation is upload. |
Output
The node outputs an array of JSON objects corresponding to each input item processed. The structure depends on the operation:
Upload: Outputs a JSON object with:
success: boolean indicating if the upload succeeded.message: confirmation string including the remote path.
Download: Outputs a JSON object containing the binary data property specified by
Binary Property Name. This property includes:data: Base64-encoded file content.mimeType: set to"application/octet-stream".fileName: the base name of the downloaded file.
List: Outputs a JSON object with a
filesarray, each element describing a file or directory with:name: file or directory name.size: size in bytes.type: either"file"or"directory".modifiedAt: last modification timestamp.
Delete and Rename: Outputs a JSON object with:
success: boolean indicating success.message: descriptive confirmation string.
If an error occurs during any operation, the output JSON contains an error field with the error message.
Dependencies
- Requires credentials for connecting to the FTP/FTPS/SFTP server, including host, port, username, password/private key, and optional TLS settings.
- Uses the following npm packages bundled within the node:
basic-ftpfor FTP and FTPS operations.ssh2-sftp-clientfor SFTP operations.
- Node.js built-in modules like
streamandpathare used internally. - No additional external services are required beyond the target FTP/FTPS/SFTP server.
Troubleshooting
- Connection issues: Ensure correct host, port, and authentication credentials are provided. For FTPS, verify TLS version compatibility and security settings.
- Permission errors: The user must have appropriate permissions on the remote server for the requested operation (upload, delete, rename).
- File not found: Verify the remote path is correct and accessible.
- Timeouts: Network latency or firewall restrictions may cause timeouts; adjust timeout settings if available.
- Binary data handling: When uploading binary files, ensure the
Binary Dataoption is enabled and the binary property name matches the input data. - Error messages: Errors thrown include descriptive messages such as "FTP operation failed" or "SFTP operation failed" followed by the underlying error. Review these messages to identify issues like protocol mismatches or invalid paths.
Links and References
- basic-ftp GitHub repository – FTP/FTPS client library used.
- ssh2-sftp-client GitHub repository – SFTP client library used.
- FTP RFC 959 – FTP protocol specification.
- TLS Protocol – TLS protocol details.
- SSH File Transfer Protocol – SFTP protocol specification.