Actions7
Overview
This node enables interaction with WebDAV servers to perform file operations such as copying, moving, deleting, uploading, and downloading files or directories. Specifically, the Copy Resource operation copies a file or directory from a source path to a destination path on the same WebDAV server.
Common scenarios where this node is beneficial include:
- Automating backups by copying files within a WebDAV storage.
- Organizing files by duplicating them into different folders.
- Integrating WebDAV-based file management into workflows without manual intervention.
For example, you can copy a document from /documents/report.docx to /archive/2024/report.docx, optionally overwriting the destination if it exists.
Properties
| Name | Meaning |
|---|---|
| Source Path | The server-relative path of the resource to copy. Must start with "/". Spaces and special characters are automatically URL-encoded. Example: /path/to/source. |
| Destination Path | The server-relative path where the resource will be copied to. Must start with "/". Spaces and special characters are automatically URL-encoded. Example: /path/to/destination. |
| Overwrite | Boolean flag indicating whether to overwrite the destination resource if it already exists. true to overwrite, false to keep existing. |
Output
The output JSON for each item includes:
success: Boolean indicating if the copy operation was successful (HTTP status code 2xx).statusCode: HTTP status code returned by the WebDAV server.sourcePath: The original source path provided.destinationPath: The target destination path provided.
Example output JSON:
{
"success": true,
"statusCode": 201,
"sourcePath": "/path/to/source",
"destinationPath": "/path/to/destination"
}
No binary data is output for the copy operation.
Dependencies
- Requires an API key credential configured with the WebDAV server base URL.
- The base URL must include the protocol (
http://orhttps://) and point to the WebDAV endpoint. - The node uses HTTP methods like COPY and requires the server to support these WebDAV extensions.
- Network access to the WebDAV server must be available from the n8n instance.
Troubleshooting
- Invalid Base URL in credentials: Ensure the base URL includes the protocol and is correctly formatted (e.g.,
https://your-server/remote.php/dav). - Destination must be on the same server: The destination path cannot be an absolute URL pointing to a different host than the base URL.
- Connection errors (ENOTFOUND, ECONNREFUSED, ETIMEDOUT): Check network connectivity, server hostname, port availability, and firewall settings.
- Absolute URLs not allowed in paths: Paths must be server-relative starting with
/; do not use full URLs in path fields. - HTTP errors: The node surfaces HTTP status codes and messages; verify permissions and existence of source and destination paths on the server.
- If the node fails but "Continue On Fail" is enabled, error details are included in the output JSON under
error.
Links and References
- WebDAV RFC 4918 – Protocol specification.
- WebDAV COPY method
- Your WebDAV server documentation for supported features and authentication setup.