Samba (SMB2) icon

Samba (SMB2)

Transfer files via Samba (SMB2)

Overview

This node enables file and folder operations on a Samba (SMB2) server, specifically supporting actions such as listing directory contents, downloading files, uploading files, deleting files or folders, and renaming/moving files or folders. The "Rename" operation allows users to rename or move a file or folder from an old path to a new path on the SMB share.

Typical use cases include automating file management tasks on network shares, such as reorganizing files by renaming or moving them, integrating SMB file storage with other systems, or maintaining file structures programmatically.

For example, you might use this node to rename a file /public/documents/old-file.txt to /public/documents/new-file.txt after processing it, or to move a folder to a different location within the SMB share.

Properties

Name Meaning
Old Path The current full path of the file or folder to be renamed or moved. Example: /public/documents/old-file.txt
New Path The new full path for the file or folder after renaming or moving. Example: /public/documents/new-file.txt
Options Additional options for the rename operation:
- Create Directories Boolean flag indicating whether to recursively create the destination directory if it does not exist when renaming. Defaults to false.

Output

The output is an array of items corresponding to each input item processed. For the rename operation, the output JSON contains the original input data unchanged unless an error occurs.

If the rename operation succeeds, the output item is essentially the same as the input item, confirming the operation was performed.

If the operation fails and "Continue On Fail" is enabled, the output item will contain an error field in its JSON describing the failure reason.

No binary data is produced by the rename operation.

Dependencies

  • Requires access to a Samba (SMB2) server.
  • Requires valid credentials for authentication to the SMB server.
  • Uses temporary file handling and streaming utilities internally but these are abstracted away from the user.
  • No additional external services are required beyond the SMB server itself.

Troubleshooting

  • Common issues:

    • Incorrect SMB server connection details or credentials can cause connection failures.
    • Insufficient permissions on the SMB share may prevent renaming or moving files/folders.
    • Specifying invalid paths or paths that do not exist will cause errors.
    • If the destination directory does not exist and "Create Directories" option is false, the rename may fail.
  • Error messages:

    • "Failed to rename file: <error message>" indicates the rename operation failed. Check SMB connection settings, file/folder permissions, and path correctness.
    • Errors during cleanup or temporary file handling are logged but typically do not affect the rename operation outcome.
  • Resolution tips:

    • Verify SMB credentials and network connectivity.
    • Ensure the source path exists and the user has write permissions on both source and destination locations.
    • Enable "Create Directories" if the destination path's parent directories might not exist.
    • Use the node's "Continue On Fail" option to handle errors gracefully in workflows.

Links and References

Discussion