New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get correct mimetype on objectstores #19888
Conversation
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@@ -349,12 +349,7 @@ public function rename($source, $target) { | |||
|
|||
public function getMimeType($path) { | |||
$path = $this->normalizePath($path); | |||
$stat = $this->stat($path); |
There was a problem hiding this comment.
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?
server/lib/private/Files/Storage/Common.php
Lines 247 to 253 in 5bf3d1b
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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
/backport to stable18 |
/backport to stable17 |
backport to stable18 in #19916 |
backport to stable17 in #19917 |
Signed-off-by: Roeland Jago Douma roeland@famdouma.nl