Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-07-15 00:42:18 +0400
committerThomas Müller <thomas.mueller@tmit.eu>2013-07-15 00:42:18 +0400
commit38eeddfc92ca5b311bf82b988849c051788840d0 (patch)
tree3449b59babac7d00cbf4c5aefe73f4b0ffe49d8e
parent528f870e094ba6074a70ca8c542131e43b70c717 (diff)
parent9f507ed642ac04098041a49d919724b77e20e869 (diff)
Merge pull request #4039 from owncloud/webdav_create_new_file
[webdav client] if the file doesn't exists; create a new one
-rw-r--r--apps/files_external/lib/webdav.php8
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) {