detect mimetype from the original filename, without the delete timestamp
This commit is contained in:
parent
eeb31420fe
commit
863aedf784
1 changed files with 9 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue