diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-07-02 16:31:10 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-09-21 13:45:25 +0200 |
commit | 4ecf710dcd071f0282d54a5a3cf59102790da69f (patch) | |
tree | bee8143c1ff29dec340b6cf629fc33a96d65a889 | |
parent | 2762f29acf4e3f8ec7a10861dcfa903195d64e4f (diff) | |
download | nextcloud-server-4ecf710dcd071f0282d54a5a3cf59102790da69f.tar.gz nextcloud-server-4ecf710dcd071f0282d54a5a3cf59102790da69f.zip |
dont download the existing file for webdav if we're going to overwrite it
-rw-r--r-- | lib/private/files/storage/dav.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/private/files/storage/dav.php b/lib/private/files/storage/dav.php index c1cf17abdee..171afd649c6 100644 --- a/lib/private/files/storage/dav.php +++ b/lib/private/files/storage/dav.php @@ -370,6 +370,7 @@ class DAV extends Common { case 'c': case 'c+': //emulate these + $tempManager = \OC::$server->getTempManager(); if (strrpos($path, '.') !== false) { $ext = substr($path, strrpos($path, '.')); } else { @@ -379,12 +380,16 @@ class DAV extends Common { if (!$this->isUpdatable($path)) { return false; } - $tmpFile = $this->getCachedFile($path); + if ($mode === 'w' or $mode === 'w+') { + $tmpFile = $tempManager->getTemporaryFile($ext); + } else { + $tmpFile = $this->getCachedFile($path); + } } else { if (!$this->isCreatable(dirname($path))) { return false; } - $tmpFile = Files::tmpFile($ext); + $tmpFile = $tempManager->getTemporaryFile($ext); } Close::registerCallback($tmpFile, array($this, 'writeBack')); self::$tempFiles[$tmpFile] = $path; |