Samba (SMB2) icon

Samba (SMB2)

Transfer files via Samba (SMB2)

Overview

This node enables file transfer operations over the Samba (SMB2) protocol, specifically allowing users to upload files to an SMB server. It is useful in scenarios where you need to programmatically place files onto a network share or remote SMB-accessible storage from within an n8n workflow.

Typical use cases include:

  • Uploading generated reports or logs to a shared folder on a Windows or Samba server.
  • Automating backup of files to a network-attached storage device.
  • Integrating legacy SMB-based file shares into modern automation workflows.

For example, you can configure this node to upload a binary file received from a previous node or upload text content as a new file to a specified path on the SMB server.

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 whether the file content to upload comes from binary data (true) or plain text (false).
Input Binary Field When uploading binary data, the name of the input binary field containing the file to upload. Default is data.
File Content When not uploading binary data, the 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 relevant information or errors. For the upload operation, the output JSON typically contains the same data as the input without additional fields unless an error occurs.

If an error happens during upload and "Continue On Fail" is enabled, the output item will contain an error field describing the failure.

No binary data is output by this node during upload.

Dependencies

  • Requires access to an SMB2-compatible server.
  • Needs credentials configured in n8n that provide authentication to the SMB server.
  • Uses temporary local file handling internally but this is abstracted away from the user.
  • No external API keys beyond the SMB server credentials are required.

Troubleshooting

  • Common issues:

    • Incorrect SMB server address or credentials leading to connection failures.
    • Insufficient permissions on the SMB share preventing file creation or overwriting.
    • Specifying a file path that does not exist or is invalid on the SMB server.
    • Missing binary data when Binary File is set to true but the specified binary field is empty.
  • Error messages:

    • "Binary data not found for key <field>": The specified binary input field does not contain data. Verify the previous node outputs binary data under the correct field name.
    • "File content not found": When uploading text content, no content was provided.
    • "Failed to upload file: <error>": General upload failure, often due to permission issues or invalid paths.
  • Resolutions:

    • Double-check SMB credentials and connectivity.
    • Ensure the target directory exists and the user has write permissions.
    • Confirm the binary field name matches the actual input data.
    • Enable "Overwrite" option if replacing existing files is intended.

Links and References

Discussion