We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2128f94 commit 585fc04Copy full SHA for 585fc04
apps/dav/lib/Connector/Sabre/File.php
@@ -544,6 +544,15 @@ public function delete() {
544
public function getContentType() {
545
$mimeType = $this->info->getMimetype();
546
547
+ if ($mimeType === 'application/octet-stream') {
548
+ $mimeType = \OC::$server->getMimeTypeDetector()->detectPath($this->info->getInternalPath());
549
+ if ($this->info->getMimetype() !== $mimeType) {
550
+ $this->info->getStorage()->getCache()->update($this->info->getId(), [
551
+ 'mimetype' => $mimeType
552
+ ]);
553
+ }
554
555
+
556
// PROPFIND needs to return the correct mime type, for consistency with the web UI
557
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'PROPFIND') {
558
return $mimeType;
0 commit comments