Skip to content
Snippets Groups Projects
Commit b9d112a4 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

fix mime type again (controller sets invalid mime type, this needs to be overwritten), re #1

parent 5e35524d
No related branches found
No related tags found
No related merge requests found
...@@ -45,7 +45,7 @@ class MarketImage extends SimpleORMap { ...@@ -45,7 +45,7 @@ class MarketImage extends SimpleORMap {
public function outputImage() { public function outputImage() {
$path = self::getImageDataPath() . "/" . $this->getId(); $path = self::getImageDataPath() . "/" . $this->getId();
header("Content-Type: " . mime_content_type($path)); header("Content-Type: " . $this['mimetype']);
header("Content-Disposition: inline; filename=" . $this['filename']); header("Content-Disposition: inline; filename=" . $this['filename']);
echo file_get_contents($path); echo file_get_contents($path);
} }
......
...@@ -112,7 +112,7 @@ class MypluginsController extends PluginController { ...@@ -112,7 +112,7 @@ class MypluginsController extends PluginController {
$file = new MarketImage(); $file = new MarketImage();
$file['plugin_id'] = $this->marketplugin->getId(); $file['plugin_id'] = $this->marketplugin->getId();
$file['filename'] = $name; $file['filename'] = $name;
$file['mimetype'] = $files['type'][$index]; $file['mimetype'] = mime_content_type($files['tmp_name'][$index]);
$file['position'] = $position; $file['position'] = $position;
$file->installFromPath($files['tmp_name'][$index]); $file->installFromPath($files['tmp_name'][$index]);
$file->store(); $file->store();
......
...@@ -155,7 +155,10 @@ class PresentingController extends PluginController { ...@@ -155,7 +155,10 @@ class PresentingController extends PluginController {
public function image_action($image_id) { public function image_action($image_id) {
$this->image = new MarketImage($image_id); $this->image = new MarketImage($image_id);
$this->set_content_type($this->image['mimetype']);
$this->image->outputImage(); $this->image->outputImage();
$this->render_nothing(); $this->render_nothing();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment