Overview
This node enables file operations on an SFTP server, including uploading files. The 'Upload File' operation allows users to upload files either from binary data within the workflow or from a local file path to a specified remote path on the SFTP server. This is useful for automating file transfers to remote servers, such as deploying website assets, backing up files, or integrating with remote systems that require file uploads.
Use Case Examples
- Uploading a file from binary data received from a previous node to a remote SFTP server path.
- Uploading a file from a local path on the machine running the workflow to a remote directory on the SFTP server.
Properties
| Name | Meaning |
|---|---|
| Binary Data | Determines whether the file to upload is provided as binary data (true) or from a local file path (false). |
| Input Binary Field | The name of the binary data field in the input to use for the file content when uploading from binary data. |
| Local Path | The local file system path of the file to upload when not using binary data. |
| Remote File Path | The target file path on the remote SFTP server where the file will be uploaded. |
| Additional Fields | Optional additional fields; currently only supports a custom file name for download operation, not used for upload. |
Output
JSON
json- The JSON output of the node, typically reflecting the input data or success status.
Dependencies
- Requires an SFTP server connection with credentials including host, port, username, and authentication (password or private key). Uses the ssh2-sftp-client library for SFTP operations.
Troubleshooting
- Ensure the remote file path is valid and the SFTP server is accessible with correct credentials.
- If uploading from binary data, verify the binary field name matches the input data.
- If uploading from a local path, ensure the file exists and the path is correct.
- Common errors include connection timeouts, permission denied on the remote server, or file not found errors for local paths.
Links
- ssh2-sftp-client NPM Package - Library used for SFTP operations in this node.