Overview
This node enables file operations over the Samba (SMB2) protocol, allowing interaction with SMB shares. Specifically, the Download operation downloads a file from an SMB share to n8n. It reads the specified file path on the remote SMB server and outputs the file content as binary data within the workflow.
Common scenarios where this node is beneficial include:
- Automating retrieval of files stored on Windows or Samba network shares.
- Integrating legacy file shares into modern workflows.
- Downloading reports, logs, or documents from shared folders for further processing.
For example, you can use this node to download a PDF report from a shared folder /public/reports/monthly-report.pdf and then pass it to an email node to send it as an attachment.
Properties
| Name | Meaning |
|---|---|
| Path | The full file path on the SMB share to download, e.g., /public/documents/file-to-download.txt. This must be the exact location of the file. |
| Put Output File in Field | The name of the binary output field where the downloaded file will be stored. Default is data. |
Output
The node outputs the downloaded file as binary data attached to each item under the specified binary property name (default "data"). The binary data contains the entire contents of the downloaded file, making it available for subsequent nodes that handle binary files (e.g., email attachments, cloud storage uploads).
The JSON part of the output item remains unchanged except for the addition of the binary field.
Dependencies
- Requires access to an SMB2-compatible file share.
- Needs credentials configured with appropriate permissions to read files on the SMB share.
- Uses temporary local files during download to stream the file content safely.
- Relies on Node.js filesystem and streaming modules internally.
Troubleshooting
- Failed to create temporary file: Ensure the environment where n8n runs has permission to create temporary files.
- Failed to download file: Common causes include incorrect file path, insufficient permissions, or network connectivity issues to the SMB server.
- Binary data not found: If the binary property name is incorrect or the file is empty, the node may fail to find the binary data.
- To resolve errors, verify SMB connection settings, file paths, and user permissions on the SMB share.
- Enable "Continue On Fail" option to allow workflow execution to proceed even if some downloads fail, capturing error details in the output.