There was an error while loading. Please reload this page.
1 parent 449b62d commit e6c8e36Copy full SHA for e6c8e36
1 file changed
src/basic_memory/cli/commands/cloud/upload.py
@@ -82,12 +82,19 @@ async def upload_path(
82
remote_path = f"/webdav/{project_name}/{relative_path}"
83
print(f"Uploading {relative_path} ({i}/{len(files_to_upload)})")
84
85
+ # Get file modification time
86
+ file_stat = file_path.stat()
87
+ mtime = int(file_stat.st_mtime)
88
+
89
# Read file content asynchronously
90
async with aiofiles.open(file_path, "rb") as f:
91
content = await f.read()
92
- # Upload via HTTP PUT to WebDAV endpoint
- response = await call_put(client, remote_path, content=content)
93
+ # Upload via HTTP PUT to WebDAV endpoint with mtime header
94
+ # Using X-OC-Mtime (ownCloud/Nextcloud standard)
95
+ response = await call_put(
96
+ client, remote_path, content=content, headers={"X-OC-Mtime": str(mtime)}
97
+ )
98
response.raise_for_status()
99
100
# Format total size based on magnitude
0 commit comments