Samba (SMB2) icon

Samba (SMB2)

Transfer files via Samba (SMB2)

Overview

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

The Delete operation specifically allows users to remove a file or folder from the SMB share by specifying its full path. This is useful for automating cleanup tasks, managing storage, or removing outdated or unwanted files remotely.

Practical example:

  • Automatically delete temporary files after processing them in a workflow.
  • Remove old backup files from a shared network drive to free up space.

Properties

Name Meaning
Path The full file path of the file or folder to delete. Example: /public/documents/file-to-delete.txt
Options Additional options: Folder (boolean) — whether folders can be deleted (true) or only files (false).

Output

The node outputs an array of JSON objects corresponding to each input item processed. For the Delete operation, the output JSON simply reflects the input data for each item if deletion was successful. If an error occurs and "Continue On Fail" is enabled, the output JSON will include an error field describing the failure.

No binary data is produced by this operation.

Example output JSON for a successful delete might look like:

{
  "json": {
    // original input data fields
  }
}

If an error occurs and continue on fail is enabled:

{
  "json": {
    "error": "Failed to delete file: <error message>"
  }
}

Dependencies

  • Requires connection credentials to an SMB2 server with appropriate permissions to delete files/folders.
  • Uses the SMB2 protocol client internally to perform file system operations.
  • No additional external services are required beyond the SMB2 server access.

Troubleshooting

  • Common issues:

    • Incorrect file path: Ensure the full path is correct and accessible on the SMB share.
    • Insufficient permissions: The user account used must have delete rights on the target file or folder.
    • Attempting to delete a folder without enabling the Folder option will cause an error.
    • Network connectivity problems with the SMB server.
  • Error messages:

    • "Failed to delete file: <error>" — General failure during deletion; check path validity and permissions.
    • Errors related to SMB connection failures or timeouts.
  • Resolutions:

    • Verify the path exists and is correctly formatted.
    • Confirm the credentials have delete permissions.
    • Enable the Folder option if deleting directories.
    • Check network connectivity and SMB server availability.

Links and References

Discussion