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:
authorJörn Friedrich Dreyer <jfd@butonic.de>2013-02-10 17:16:45 +0400
committerJörn Friedrich Dreyer <jfd@butonic.de>2013-02-10 17:16:45 +0400
commit1263511a179fb1508f41207d61d76739e087b239 (patch)
treec8d848e174f6ff0f14971ae81f95663aa17e8af7 /lib/connector
parent1c56539c01c162676a05d90e3598b7d68394ac73 (diff)
append .part to put files
Diffstat (limited to 'lib/connector')
-rw-r--r--lib/connector/sabre/file.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/connector/sabre/file.php b/lib/connector/sabre/file.php
index 1c18a391742..521c5f0571d 100644
--- a/lib/connector/sabre/file.php
+++ b/lib/connector/sabre/file.php
@@ -45,7 +45,13 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D
*/
public function put($data) {
- \OC\Files\Filesystem::file_put_contents($this->path,$data);
+ // mark file as partial while uploading (ignored by the scanner)
+ $partpath = $this->path . '.part';
+
+ \OC\Files\Filesystem::file_put_contents($partpath, $data);
+
+ // rename to correct path
+ \OC\Files\Filesystem::rename($partpath, $this->path);
return OC_Connector_Sabre_Node::getETagPropertyForPath($this->path);
}