Overview
This node enables file operations over the Samba (SMB2) protocol, specifically focusing here on the Upload operation. It allows users to upload files to a remote SMB server by specifying the full path where the file should be stored. The node supports uploading either binary files or text content and provides an option to overwrite existing files.
Common scenarios include:
- Automating file uploads to shared network drives in corporate environments.
- Integrating SMB file storage with workflows that generate or modify files.
- Backing up data or logs to SMB shares.
Practical example:
- Upload a generated PDF report from a workflow directly to a shared folder on a Windows file server.
- Save image files received from another service into a network share for further processing.
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 flag indicating if the file content is provided as binary data (true) or as plain text (false). |
| Input Binary Field | When Binary File is true, this specifies the name of the input binary field containing the file data to upload. Default is "data". |
| File Content | When Binary File is false, this is the text content of the file to upload. |
| Options > Overwrite | Whether to overwrite the file if it already exists at the target path (true or false). Default is false. |
Output
The node outputs the original input items unchanged upon successful upload. If an error occurs during upload and "Continue On Fail" is enabled, the output item will contain an error property in its JSON describing the failure.
No additional JSON fields are added on success. The node does not produce binary output.
Dependencies
- Requires a valid connection to an SMB2-compatible server.
- Needs credentials for authenticating with the SMB server (an API key or authentication token configured in n8n).
- Uses temporary local files internally when handling downloads but for upload it reads directly from input binary or text.
Troubleshooting
Common issues:
- File path incorrect or inaccessible on the SMB server.
- Insufficient permissions to write or overwrite files.
- Missing or incorrectly named binary input field when uploading binary data.
- Network connectivity problems with the SMB server.
Error messages:
"Binary data not found for key <field>": The specified binary field does not exist in the input. Check the field name and ensure the previous node outputs binary data correctly."File content not found": No text content was provided whenBinary Fileis set to false."Failed to upload file: <error>": General upload failure, often due to permission issues or invalid paths.
Resolutions:
- Verify the full file path is correct and accessible.
- Confirm the user account used has write permissions on the SMB share.
- Double-check the binary field name matches the actual input.
- Enable "Overwrite" option if replacing existing files is intended.
- Test SMB connection separately to ensure network access.
Links and References
- Samba (SMB) Protocol Overview
- n8n Documentation on Binary Data Handling
- Node.js fs module (used internally for file streams)