]> source.dussan.org Git - nextcloud-server.git/commitdiff
rewind and update error message
authorRobin Appelman <icewind@owncloud.com>
Mon, 13 Apr 2015 12:14:48 +0000 (14:14 +0200)
committerRobin Appelman <icewind@owncloud.com>
Mon, 13 Apr 2015 12:14:48 +0000 (14:14 +0200)
lib/private/connector/sabre/file.php

index 1e19880857c1e5fcb5b785839c390218a330f352..bc4535657dc19e00c3d936ac6dfa9a44667faae6 100644 (file)
@@ -85,6 +85,7 @@ class File extends Node implements IFile {
                if (is_string($data)) {
                        $stream = fopen('php://temp', 'r+');
                        fwrite($stream, $data);
+                       fseek($stream, 0);
                        $data = $stream;
                };
                try {
@@ -121,7 +122,7 @@ class File extends Node implements IFile {
                try {
                        $target = $storage->fopen($internalPartPath, 'wb');
                        if ($target === false) {
-                               \OC_Log::write('webdav', '\OC\Files\Filesystem::file_put_contents() failed', \OC_Log::ERROR);
+                               \OC_Log::write('webdav', '\OC\Files\Filesystem::fopen() failed', \OC_Log::ERROR);
                                $this->fileView->unlink($partFilePath);
                                // because we have no clue about the cause we can only throw back a 500/Internal Server Error
                                throw new Exception('Could not write file contents');