Samba (SMB2) icon

Samba (SMB2)

Transfer files via Samba (SMB2)

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 transfers to shared network drives in corporate environments.
  • Integrating legacy SMB-based storage into modern workflows.
  • Uploading generated reports, logs, or documents directly to SMB shares from n8n workflows.

Practical example:

  • A workflow generates a PDF report and uses this node to upload the PDF file to a shared folder on an SMB server for team access.

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 comes from binary data (true) or 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 plain 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). Defaults to false.

Output

The node outputs the original input items unchanged upon successful upload. If an error occurs during upload and the node is configured to continue on failure, the output item will contain an error property in its JSON with a descriptive message.

No additional JSON fields are added on success. The node does not produce binary output.

Dependencies

  • Requires connection credentials to an SMB2 server (an API key or authentication token must be configured in n8n).
  • Uses temporary local file handling internally but this is abstracted away from the user.
  • No external APIs beyond the SMB2 server are required.

Troubleshooting

Common Issues

  • File not found in binary input: If the specified binary input field does not exist or contains no data, the node will error.
  • Permission denied: Insufficient permissions on the SMB share can cause upload failures.
  • File already exists: If overwrite is disabled and the file exists, the upload will fail.
  • Connection errors: Network issues or incorrect SMB credentials will prevent connecting to the SMB server.

Error Messages and Resolutions

  • Binary data not found for key <field>: Check that the binary field name matches the input data and that the previous node provides binary data.
  • File content not found: When uploading text content, ensure the "File Content" property is not empty.
  • Failed to upload file: <error details>: Verify SMB server accessibility, credentials, file path correctness, and permissions.
  • Failed to create temporary file: Indicates internal issues creating temp files; check disk space and permissions on the n8n host.

Enabling "Continue On Fail" allows workflows to proceed despite individual upload errors, with error details included in output.

Links and References

Discussion