From 2165f10aaf58d7662d6ffb9cb432b70672fc0738 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 30 Oct 2019 17:24:55 +0100 Subject: hookup creation and upload time into dav Signed-off-by: Robin Appelman --- apps/dav/lib/Connector/Sabre/File.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'apps/dav/lib/Connector/Sabre/File.php') diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php index dd25b046bcf..bc72fd24e71 100644 --- a/apps/dav/lib/Connector/Sabre/File.php +++ b/apps/dav/lib/Connector/Sabre/File.php @@ -291,6 +291,19 @@ class File extends Node implements IFile { } } + $fileInfoUpdate = [ + 'upload_time' => time() + ]; + + // allow sync clients to send the creation time along in a header + if (isset($this->request->server['HTTP_X_OC_CTIME'])) { + $ctime = $this->sanitizeMtime($this->request->server['HTTP_X_OC_CTIME']); + $fileInfoUpdate['creation_time'] = $ctime; + $this->header('X-OC-CTime: accepted'); + } + + $this->fileView->putFileInfo($this->path, $fileInfoUpdate); + if ($view) { $this->emitPostHooks($exists); } -- cgit v1.2.3