Samba (SMB2) icon

Samba (SMB2)

Transfer files via Samba (SMB2)

Overview

This node enables file transfer operations over the Samba (SMB2) protocol, commonly used for sharing files and printers within local networks. The Upload operation specifically allows users to upload files to an SMB server by specifying the full path where the file should be stored.

Typical use cases include:

  • Automating file uploads to shared network drives.
  • Integrating with legacy systems that expose SMB shares.
  • Backing up or synchronizing files to a central SMB server.

For example, you can upload a report generated in a workflow directly to a shared folder accessible by your team, either by providing the file content as text or by uploading binary data from previous nodes.

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 Whether the file content is provided as binary data (true) or as plain text (false).
Input Binary Field If Binary File is true, this specifies the name of the input binary field containing the file data. Default is "data".
File Content If 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 augmented with any error information if the upload fails. On success, the output item remains unchanged (no additional JSON fields are added).

  • The json field contains the original input data.
  • In case of failure, an error property is added to the json describing the failure reason.
  • No binary output is produced by the upload operation.

Dependencies

  • Requires connection credentials to an SMB2 server (an API key or authentication token configured in n8n).
  • Uses temporary files and streams internally to handle binary data.
  • Relies on the SMB2 client library to perform file operations.

Troubleshooting

  • Common issues:

    • File not found in the specified binary input field when Binary File is enabled.
    • Permission denied errors due to insufficient SMB share permissions.
    • Network connectivity issues to the SMB server.
    • Attempting to upload to a path where a file already exists without enabling overwrite.
  • Error messages:

    • "Binary data not found for key <field>": The specified binary field does not exist in the input item. Ensure the correct binary field name is set.
    • "File content not found": When uploading text content, no content was provided.
    • "Failed to upload file: <error>": General upload failure, often related to permissions or network issues.
  • Resolutions:

    • Verify the binary field name matches the input data.
    • Check SMB server permissions and ensure the user has write access.
    • Enable the "Overwrite" option if replacing existing files is intended.
    • Confirm network connectivity and SMB server availability.

Links and References

Discussion