Samba (SMB2) icon

Samba (SMB2)

Transfer files via Samba (SMB2)

Overview

This node allows users to delete files or folders on a Samba (SMB2) server. It connects to the SMB server and removes the specified file or folder based on the provided path. This operation is useful for automating cleanup tasks, managing remote file storage, or integrating SMB file management into workflows.

Practical examples:

  • Automatically deleting temporary files after processing.
  • Removing outdated reports or logs from a shared network drive.
  • Cleaning up user-uploaded files after a certain period.

Properties

Name Meaning
Path The full file path of the file or folder to delete, e.g., /public/documents/file.txt.
Options Collection of options:
- Folder: Boolean indicating whether folders can be deleted (true allows folder deletion).

Output

The output is an array of JSON objects corresponding to each input item processed. Each object contains the original input data. If the deletion fails for an item and "Continue On Fail" is enabled, the output JSON for that item will include an error field describing the failure reason.

No binary data is output by this operation.

Dependencies

  • Requires connection credentials to access the SMB2 server (an API key or authentication token configured in n8n).
  • Uses the SMB2 protocol to communicate with the remote file share.
  • No additional external services are required beyond the SMB server itself.

Troubleshooting

  • Common issues:

    • Incorrect file path or missing full path may cause failures.
    • Insufficient permissions on the SMB server to delete files or folders.
    • Attempting to delete a folder without enabling the "Folder" option.
    • Network connectivity problems to the SMB server.
  • Error messages:

    • "Failed to delete file: <error message>": Indicates the deletion failed due to permission issues, non-existent path, or other SMB errors.
    • "Check your SMB connection settings and file permissions": Suggests verifying credentials and access rights.
  • Resolutions:

    • Ensure the full and correct path is provided.
    • Enable the "Folder" option if deleting directories.
    • Verify SMB credentials and permissions allow deletion.
    • Check network connectivity and SMB server availability.
    • Use "Continue On Fail" to handle errors gracefully in workflows.

Links and References

Discussion