Samba (SMB2) icon

Samba (SMB2)

Transfer files via Samba (SMB2)

Overview

This node enables file operations over the Samba (SMB2) protocol, allowing interaction with SMB shares. The Download operation specifically downloads a file from an SMB share to n8n. It is useful in scenarios where you need to retrieve files stored on network shares for further processing or integration within your workflows.

Practical examples include:

  • Automatically downloading reports or logs from a shared network folder.
  • Retrieving configuration files stored on a central SMB server.
  • Integrating legacy file shares into modern automation pipelines.

Properties

Name Meaning
Path The full path of the file to download from the SMB share. Example: /public/documents/file-to-download.txt
Put Output File in Field The name of the binary output field where the downloaded file will be stored. Default is data.

Output

The node outputs the downloaded file as binary data attached to each item under the specified binary property name (default "data"). The binary data contains the contents of the downloaded file, making it available for subsequent nodes that can process binary files (e.g., write to disk, upload elsewhere).

The JSON part of the output item remains unchanged except for the addition of this binary data field.

Dependencies

  • Requires access to an SMB2-compatible file share.
  • Needs an API key credential configured in n8n for authenticating to the SMB server.
  • Uses temporary local files during download to stream the file content before attaching it as binary data.

Troubleshooting

  • Failed to create temporary file: Indicates issues creating a temp file locally. Ensure the n8n environment has permissions to write temp files.
  • Failed to download file: Common causes include incorrect file path, insufficient permissions on the SMB share, or connectivity issues. Verify the path and credentials.
  • Binary data not found: If the binary property name is incorrect or the file is empty, the node may fail to find the binary data.
  • Cleanup errors during temporary file removal are logged but do not stop execution.

If the node is set to continue on failure, errors are added to the item's JSON under an error field instead of stopping the workflow.

Links and References

Discussion