Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions lib/private/Files/ObjectStore/ObjectStoreStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,12 +349,7 @@ public function rename($source, $target) {

public function getMimeType($path) {
$path = $this->normalizePath($path);
$stat = $this->stat($path);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I missing something or is in that case mime type detection only done by file extension?

if ($this->is_dir($path)) {
return 'httpd/unix-directory';
} elseif ($this->file_exists($path)) {
return \OC::$server->getMimeTypeDetector()->detectPath($path);
} else {
return false;
}

Same for the Local storage actually

class Local extends \OC\Files\Storage\Common {
Shouldn't that at least use the result from stat?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For local it makes sense. For objectstore we have nothing better.
In anycase I woud do this for now. And create an issue for the rest.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, thanks, yes I already thought that this would be all we have for object storage.

if (is_array($stat)) {
return $stat['mimetype'];
} else {
return false;
}
return parent::getMimeType($path);
}

public function touch($path, $mtime = null) {
Expand Down