diff options
author | Robin Appelman <robin@icewind.nl> | 2017-11-08 17:51:02 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2017-11-15 14:23:47 +0100 |
commit | e041c7a92f78b0dc2ca0ff820353e154dd67d76b (patch) | |
tree | bcde557f306cacdcdb753716892211f6145cc06d | |
parent | a21f2c2813ae15d1811eb357fbb9a2c3b5769142 (diff) | |
download | nextcloud-server-e041c7a92f78b0dc2ca0ff820353e154dd67d76b.tar.gz nextcloud-server-e041c7a92f78b0dc2ca0ff820353e154dd67d76b.zip |
Use non empty files for object store touch
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r-- | lib/private/Files/ObjectStore/ObjectStoreStorage.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php index 15df808684b..79ce7ee3247 100644 --- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php @@ -364,7 +364,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common { $fileId = $this->getCache()->put($path, $stat); try { //read an empty file from memory - $this->objectStore->writeObject($this->getURN($fileId), fopen('php://memory', 'r')); + $this->file_put_contents($path, ' '); } catch (\Exception $ex) { $this->getCache()->remove($path); $this->logger->logException($ex, [ @@ -392,7 +392,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common { $stat['storage_mtime'] = $mTime; // run path based detection first, to use file extension because $tmpFile is only a random string - $mimetypeDetector = \OC::$server->getMimeTypeDetector(); + $mimetypeDetector = \OC::$server->getMimeTypeDetector(); $mimetype = $mimetypeDetector->detectPath($path); if ($mimetype === 'application/octet-stream') { $mimetype = $mimetypeDetector->detect($tmpFile); |