Skip to content
Snippets Groups Projects
Unverified Commit c566b285 authored by Robin Appelman's avatar Robin Appelman
Browse files

Use non empty files for object store touch


Signed-off-by: default avatarRobin Appelman <robin@icewind.nl>
parent 70a4860c
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment