From e83ea3000443a61453cf3c6a393b685086793e2a Mon Sep 17 00:00:00 2001 From: Victor Dubiniuk Date: Wed, 9 Jul 2014 01:18:18 +0300 Subject: [PATCH] Use filters in viewer --- ajax/download.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ajax/download.php b/ajax/download.php index 1905ffe3..c88180f7 100644 --- a/ajax/download.php +++ b/ajax/download.php @@ -16,7 +16,14 @@ namespace OCA\Documents; $path = Helper::getArrayValueByKey($_GET, 'path'); if (!empty($path)){ - $fullPath = '/files' . $path; + if (\OC\Files\Filesystem::getMimeType($path)!==Filter_Office::NATIVE_MIMETYPE){ + $fileInfo = \OC\Files\Filesystem::getFileInfo($path); + $file = new File($fileInfo->getId()); + $genesis = new Genesis($file); + $fullPath = $genesis->getPath(); + } else { + $fullPath = '/files' . $path; + } $download = new Download(\OCP\User::getUser(), $fullPath); $download->sendResponse(); }