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.
Common scenarios for this node include automating file management tasks on network shares, integrating SMB file storage with workflows, or migrating/organizing files remotely without manual intervention.
For example, you can use the Rename operation to move a file from one folder to another on your SMB server or simply rename a file to a new name within the same directory.
Properties
| Name | Meaning |
|---|---|
| Old Path | The full current path of the file or folder to rename/move. Example: /public/documents/old-file.txt |
| New Path | The full new path where the file or folder should be renamed/moved to. Example: /public/documents/new-file.txt |
| Options | Additional options for the rename operation: |
| Create Directories | Boolean flag indicating whether to recursively create destination directories if they do not exist when renaming/moving. Defaults to false. |
Output
The output is an array of JSON objects corresponding to each input item processed. For the Rename operation, the output JSON reflects the original input data unchanged if successful. If an error occurs during renaming, the output JSON will contain an error field describing the failure.
No binary data is produced by the Rename operation.
Dependencies
- Requires access to an SMB2-compatible server.
- Needs credentials for authenticating with the SMB server (an API key or authentication token configured in n8n).
- Uses internal helper functions to establish the SMB connection and perform file operations.
- No additional external services are required beyond the SMB server.
Troubleshooting
Common issues:
- Incorrect paths: Ensure that both old and new paths are correct and accessible on the SMB server.
- Permissions: The user authenticated must have sufficient permissions to rename/move files or folders.
- Destination directory missing: If the destination directory does not exist and the "Create Directories" option is false, the rename may fail.
- Network connectivity problems with the SMB server.
Error messages:
"Failed to rename file: <error message>": Indicates the rename operation failed. Check the SMB connection settings, file/folder permissions, and path correctness.- Errors related to missing directories can be resolved by enabling the "Create Directories" option if appropriate.
Resolution tips:
- Verify SMB server credentials and connectivity.
- Double-check the specified old and new paths.
- Enable "Create Directories" if moving files into new folders.
- Use the node's "Continue On Fail" option to handle errors gracefully in workflows.
Links and References
If you need details on other operations or resources, please provide their names.