diff options
-rw-r--r-- | apps/files_trashbin/ajax/preview.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/files_trashbin/ajax/preview.php b/apps/files_trashbin/ajax/preview.php index a0846b051c7..945466705c1 100644 --- a/apps/files_trashbin/ajax/preview.php +++ b/apps/files_trashbin/ajax/preview.php @@ -29,8 +29,15 @@ if($maxX === 0 || $maxY === 0) { } try{ - $preview = new \OC\Preview(\OC_User::getUser(), 'files_trashbin/files'); - $preview->setFile($file); + $preview = new \OC\Preview(\OC_User::getUser(), 'files_trashbin/files', $file); + $view = new \OC\Files\View('/'.\OC_User::getUser(). '/files_trashbin/files'); + if ($view->is_dir($file)) { + $mimetype = 'httpd/unix-directory'; + } else { + $mimetype = \OC_Helper::getFileNameMimeType(pathinfo($file, PATHINFO_FILENAME)); + } + $preview->setMimetype($mimetype); + $preview->setMimetype($mimetype); $preview->setMaxX($maxX); $preview->setMaxY($maxY); $preview->setScalingUp($scalingUp); |