diff options
-rw-r--r-- | apps/files_external/lib/webdav.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/files_external/lib/webdav.php b/apps/files_external/lib/webdav.php index c2fe7c67b58..4869322d87a 100644 --- a/apps/files_external/lib/webdav.php +++ b/apps/files_external/lib/webdav.php @@ -234,7 +234,13 @@ class DAV extends \OC\Files\Storage\Common{ $mtime=time(); } $path=$this->cleanPath($path); - $this->client->proppatch($path, array('{DAV:}lastmodified' => $mtime)); + + // if file exists, update the mtime, else create a new empty file + if ($this->file_exists($path)) { + $this->client->proppatch($path, array('{DAV:}lastmodified' => $mtime)); + } else { + $this->file_put_contents($path, ''); + } } public function getFile($path, $target) { |