summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/ajax
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-11-28 18:59:12 +0100
committerBjoern Schiessle <schiessle@owncloud.com>2013-11-28 18:59:12 +0100
commit863aedf784d582a458c8befd709795f2595e3ba6 (patch)
treea8fe080cff9344de07b883af5358568d68d66e37 /apps/files_trashbin/ajax
parenteeb31420fe2185b4caf2fbf564b5ac6177d348c3 (diff)
downloadnextcloud-server-863aedf784d582a458c8befd709795f2595e3ba6.tar.gz
nextcloud-server-863aedf784d582a458c8befd709795f2595e3ba6.zip
detect mimetype from the original filename, without the delete timestamp
Diffstat (limited to 'apps/files_trashbin/ajax')
-rw-r--r--apps/files_trashbin/ajax/preview.php11
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);