File tree Expand file tree Collapse file tree
src/basic_memory/cli/commands/cloud Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -82,12 +82,19 @@ async def upload_path(
8282 remote_path = f"/webdav/{ project_name } /{ relative_path } "
8383 print (f"Uploading { relative_path } ({ i } /{ len (files_to_upload )} )" )
8484
85+ # Get file modification time
86+ file_stat = file_path .stat ()
87+ mtime = int (file_stat .st_mtime )
88+
8589 # Read file content asynchronously
8690 async with aiofiles .open (file_path , "rb" ) as f :
8791 content = await f .read ()
8892
89- # Upload via HTTP PUT to WebDAV endpoint
90- 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+ )
9198 response .raise_for_status ()
9299
93100 # Format total size based on magnitude
You can’t perform that action at this time.
0 commit comments