summaryrefslogtreecommitdiffstats
path: root/core/ajax
diff options
context:
space:
mode:
Diffstat (limited to 'core/ajax')
-rw-r--r--core/ajax/preview2.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/ajax/preview2.php b/core/ajax/preview2.php
index b2bbf64c6d2..7ac50282190 100644
--- a/core/ajax/preview2.php
+++ b/core/ajax/preview2.php
@@ -30,7 +30,11 @@ $file = $userFolder->get($file);
$p = new \OC\Preview2(\OC::$server->getRootFolder(),
\OC::$server->getConfig(),
\OC::$server->getPreviewManager(),
- $file);
+ $file,
+ \OC::$server->getAppDataDir('preview'));
-$p->getPreview($maxX, $maxY, !$keepAspect, $mode);
+$image = $p->getPreview($maxX, $maxY, !$keepAspect, $mode);
+
+header('Content-Type: ' . $image->getMimeType());
+echo $image->getContent();