Basic FTP icon

Basic FTP

Implement the operations from the "basic-ftp" library

Overview

The Basic FTP node's "Download" operation allows you to download a file from an FTP server and attach it as binary data to your workflow. This is useful for automating the retrieval of files such as reports, logs, images, or any other documents stored on remote FTP servers. Common scenarios include scheduled downloads of backup files, fetching data for further processing, or integrating with legacy systems that use FTP for file exchange.

Example Use Cases:

  • Downloading daily sales reports from a partner's FTP server.
  • Fetching log files for automated analysis.
  • Retrieving images or documents for archiving or further processing in n8n.

Properties

Name Type Meaning
Binary Property String Name of the binary property where the downloaded file will be stored in the output item.
Path String The path to the file on the FTP server that you want to download.

Output

  • The node outputs an item with:
    • json: The original JSON data from the input item (passed through).
    • binary: An object containing the downloaded file under the key specified by Binary Property. The binary data includes metadata such as filename and mime type, making it ready for downstream nodes that process files.

Example Output Structure:

{
  "json": { /* original input data */ },
  "binary": {
    "data": {
      "data": "<base64-encoded file content>",
      "fileName": "example.txt",
      "mimeType": "text/plain"
    }
  }
}
  • The key "data" above will match the value set in Binary Property.

Dependencies

  • FTP Server: You must have access credentials (host, port, username, password) for the target FTP server.
  • n8n Credentials: The node requires a credential named basicFtpApi to connect to the FTP server.
  • External Libraries: Uses the basic-ftp npm package internally (handled by the node).

Troubleshooting

Common Issues:

  • Invalid Credentials: If the FTP credentials are incorrect, connection will fail. Double-check host, port, username, and password.
  • File Not Found: If the specified path does not exist on the server, you'll receive an error like No such file.
  • Permission Denied: If the user lacks permission to read the file, an error will occur.
  • Network Issues: Connectivity problems between n8n and the FTP server can cause timeouts or failures.

Error Messages:

  • The operation "..." is not supported!: Ensure you selected a valid operation.
  • No such file: Check the Path property for typos or missing directories.
  • Login authentication failed: Verify your FTP credentials.

How to Resolve:

  • Confirm all property values, especially Path and Binary Property.
  • Test FTP credentials outside n8n if possible.
  • Ensure the FTP server is reachable from your n8n instance.

Links and References

Discussion