diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-07-12 13:25:37 +0200 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-07-22 09:15:19 +0200 |
commit | da892d69ab724354e1b3ee251e540ba306fffe44 (patch) | |
tree | 4eaf8ab4b94a6afa719013961eae5e198a2d4e47 | |
parent | 01f3f8e0ccd13cb8e3e05e2c7adf08bdb13a11eb (diff) | |
download | nextcloud-server-da892d69ab724354e1b3ee251e540ba306fffe44.tar.gz nextcloud-server-da892d69ab724354e1b3ee251e540ba306fffe44.zip |
if the file doesn't exists; create a new one. We use this to create new text files in the web interface
-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) { |