WebDAV Client
Quick Start
Use this skill to interact with WebDAV servers (like NAS) using Python.
Dependencies
This skill requires webdavclient3:
bash
pip install webdavclient3
Usage
1. Upload Script
Use the included utility script for quick uploads:
bash
python ~/.cursor/skills/webdav-client/scripts/nas_upload.py \ --host "http://NAS_IP:5005" \ --user "username" \ --password "password" \ --src "./local_file.txt" \ --dest "/remote/path/file.txt"
2. Python Usage
To integrate into other scripts:
python
from webdav3.client import Client
options = {
'webdav_hostname': "http://NAS_IP:5005",
'webdav_login': "user",
'webdav_password': "password"
}
client = Client(options)
# Upload
client.upload_sync(remote_path="remote/file.txt", local_path="local/file.txt")
# Download
client.download_sync(remote_path="remote/file.txt", local_path="local/file.txt")
# List
files = client.list("remote_dir")
Common Issues
- •401 Unauthorized: Check credentials.
- •404 Not Found: Ensure parent directories exist on remote.
- •Certificate Errors: If using HTTPS with self-signed certs, verify SSL settings.