Samba (SMB2) icon

Samba (SMB2)

Transfer files via Samba (SMB2)

Overview

This node enables file operations over the Samba (SMB2) protocol, specifically allowing users to upload files to an SMB share. It is useful in scenarios where you need to programmatically transfer files from n8n workflows to network shares commonly used in Windows environments or mixed OS networks.

For the Upload operation, the node supports uploading either binary files or text content to a specified path on the SMB server. This is beneficial when automating file distribution, backups, or integration with legacy systems that expose SMB shares.

Example use cases:

  • Uploading generated reports or logs from an automation workflow to a shared company folder.
  • Saving processed images or documents to a network drive accessible by other team members.
  • Automating deployment of configuration files to servers via SMB shares.

Properties

Name Meaning
Path The full file path on the SMB share where the file will be uploaded. Example: /public/documents/file-to-upload.txt
Binary File Boolean flag indicating if the file content to upload is binary (true) or plain text (false).
Input Binary Field When uploading binary data, this is the name of the input binary field containing the file data. Default is data.
File Content When uploading text content (non-binary), this is the string 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 augmented with any error information if the upload fails. On success, the output item remains unchanged (no additional JSON fields are added).

  • If the upload succeeds, the output item is passed through as-is.
  • If the upload fails and "Continue On Fail" is enabled, the output item will include an error field describing the failure reason.

No binary data is output by this operation.

Dependencies

  • Requires a valid SMB2 connection configured via credentials in n8n.
  • Uses temporary file handling and streaming internally but these are abstracted away from the user.
  • No external API keys beyond the SMB authentication credentials are needed.

Troubleshooting

  • Common issues:

    • Missing or incorrect SMB credentials leading to authentication failures.
    • Incorrect file paths causing "file not found" or permission errors.
    • Attempting to upload binary data without specifying the correct binary input field.
    • Trying to overwrite existing files without enabling the overwrite option.
  • Error messages:

    • "Binary data not found for key <field>": The specified binary input field does not exist or is empty. Ensure the binary data is correctly provided in the input.
    • "File content not found": When uploading text content, no content was provided.
    • "Failed to upload file: <reason>": General upload failure, often due to permissions or connectivity issues.
  • Resolutions:

    • Verify SMB credentials and network accessibility.
    • Double-check the full file path syntax.
    • Confirm the binary input field name matches the actual input.
    • Enable the overwrite option if replacing existing files is intended.

Links and References

Discussion