summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2016-10-07 14:16:38 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2016-11-03 14:00:32 +0100
commit743132650aa906d9468d633c2c5ca382e565df84 (patch)
treed9420b902aaf838ec7fac20944d2ed72c0100900 /core
parent958c1289b15f5bd877dd7ff3b7cf3540a0c5198a (diff)
downloadnextcloud-server-743132650aa906d9468d633c2c5ca382e565df84.tar.gz
nextcloud-server-743132650aa906d9468d633c2c5ca382e565df84.zip
Move to AppData
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'core')
-rw-r--r--core/ajax/preview2.php8
-rw-r--r--core/routes.php4
2 files changed, 8 insertions, 4 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();
diff --git a/core/routes.php b/core/routes.php
index 4b73a86042a..9ccf0e653eb 100644
--- a/core/routes.php
+++ b/core/routes.php
@@ -69,11 +69,11 @@ $this->create('search_ajax_search', '/core/search')
->actionInclude('core/search/ajax/search.php');
// Routing
$this->create('core_ajax_preview', '/core/preview')
- ->actionInclude('core/ajax/preview.php');
+ ->actionInclude('core/ajax/preview2.php');
$this->create('core_ajax_preview2', '/core/preview2')
->actionInclude('core/ajax/preview2.php');
$this->create('core_ajax_preview', '/core/preview.png')
- ->actionInclude('core/ajax/preview.php');
+ ->actionInclude('core/ajax/preview2.php');
$this->create('core_ajax_update', '/core/ajax/update.php')
->actionInclude('core/ajax/update.php');