Overview
This node enables file operations over the Samba (SMB2) protocol, specifically focusing on uploading files to an SMB share in the "Upload" operation. It allows users to upload either binary files or text content to a specified path on a remote SMB server.
Common scenarios where this node is beneficial include:
- Automating file uploads to shared network drives in corporate environments.
- Integrating file storage workflows with legacy SMB-based file servers.
- Uploading generated reports, logs, or documents directly from n8n workflows to SMB shares.
Practical example:
- A workflow generates a PDF report and uses this node to upload the PDF as a binary file to a shared folder on an SMB server.
- Alternatively, a workflow creates a text configuration file dynamically and uploads it as plain text content to a specific path on the SMB share.
Properties
| Name | Meaning |
|---|---|
| Path | The full file path on the SMB server where the file will be uploaded. Example: /public/documents/file-to-upload.txt |
| Binary File | Boolean option to specify if the file content is binary (true) or plain text (false). |
| Input Binary Field | When uploading a binary file, the name of the input binary field containing the file data. Default is data. |
| File Content | When uploading as plain text, the actual text content of the file to upload. |
| Options | Additional options for the upload operation: |
| Overwrite | Whether to overwrite the file if it already exists on the SMB server (true or false). Default is false. |
Output
The node outputs the original input items augmented with any error information if the upload fails. On successful upload, the output item remains unchanged.
- The
jsonoutput field contains the original input JSON data. - If an error occurs during upload, an
errorproperty is added to thejsonfield describing the failure reason. - This node does not produce new binary output data.
Dependencies
- Requires connection credentials to an SMB2 server (an API key or authentication token configured in n8n).
- Uses temporary local file handling internally but this is abstracted away from the user.
- No additional external services are required beyond access to the SMB server.
Troubleshooting
Common issues:
- Incorrect SMB server credentials or insufficient permissions can cause upload failures.
- Specifying a non-existent directory path without enabling overwrite may cause errors.
- Missing binary data when
Binary Fileis set to true and the specified binary field does not exist. - Empty file content when
Binary Fileis false.
Error messages:
"Binary data not found for key <field>": The specified binary input field does not contain data. Verify the binary field name and ensure the previous node provides the binary data."File content not found": No text content was provided for upload when expected."Failed to upload file: <error details>": General upload failure, often due to permission issues or invalid paths. Check SMB connection settings and file permissions.
To handle errors gracefully, enable the node's "Continue On Fail" option to allow workflow execution to proceed despite individual upload failures.
Links and References
- Samba (SMB) Protocol Overview
- n8n Documentation - Working with Binary Data
- Node.js fs module (used internally for file streaming)