Samba (SMB2) icon

Samba (SMB2)

Transfer files via Samba (SMB2)

Overview

This node enables interaction with files and folders on a Samba (SMB2) server. It supports operations such as listing folder contents, downloading files, uploading files, deleting files or folders, and renaming/moving files or folders.

The List operation specifically retrieves the contents of a specified folder path on the SMB server. This is useful for scenarios where you want to dynamically explore or process files stored on a network share, such as automating file management workflows, monitoring shared directories, or integrating SMB-hosted files into other systems.

Example use case:
You have a shared folder on your company’s SMB server containing daily reports. Using this node’s List operation, you can fetch the list of files in that folder and then trigger further processing like downloading or analyzing those files automatically.

Properties

Name Meaning
Folder The path of the folder on the SMB server whose contents you want to list. For example: /public/folder

Output

The output is an array of JSON objects, each representing an item (file or directory) inside the specified folder. Each object contains the following fields:

  • type: "d" for directories, "l" for files (links).
  • name: The base name of the item (file or folder name).
  • path: The full path of the item on the SMB server.
  • attributes: File attributes as provided by the SMB server.
  • createTime: Creation timestamp (if available).
  • accessTime: Last access timestamp (if available).
  • modifyTime: Last modification timestamp (if available).
  • changeTime: Last change timestamp (if available).
  • size: Size of the file in bytes.

This structured output allows downstream nodes to filter, analyze, or manipulate files and folders based on their metadata.

Dependencies

  • Requires connection credentials to an SMB2 server (an API key or authentication token configured in n8n credentials).
  • Uses internal helper functions to establish the SMB connection and perform file system operations.
  • Temporary file handling and streaming utilities are used internally for other operations but not relevant for the List operation.

Troubleshooting

  • Common issues:
    • Incorrect folder path or insufficient permissions may cause errors when listing directory contents.
    • Network connectivity problems to the SMB server can prevent successful connection.
  • Error messages:
    • Errors related to "Failed to list folder" typically indicate permission or path issues.
    • Connection errors suggest checking SMB server availability and credential correctness.
  • Resolution tips:
    • Verify the folder path exists and the user has read permissions.
    • Confirm SMB server address and credentials are correct.
    • Ensure network access to the SMB server from the n8n instance.

Links and References

Discussion