Commit 8e76694f authored by Mark Harding's avatar Mark Harding

(feat): blogs now use common storage engine

parent d08082dc
......@@ -132,18 +132,20 @@ class blog implements Interfaces\Api
case "header":
$blog = new entities\Blog($pages[1]);
$header = new \ElggFile();
$header->owner_guid = $blog->owner_guid;
$header->setFilename("blog/{$blog->guid}.jpg");
header('Content-Type: image/jpeg');
header('Expires: ' . date('r', time() + 864000));
header("Pragma: public");
header("Cache-Control: public");
try {
echo file_get_contents($header->getFilenameOnFilestore());
} catch (\Exception $e) {
}
exit;
$header->owner_guid = $blog->owner_guid;
$header->setFilename("blog/{$blog->guid}.jpg");
$header->open('read');
header('Content-Type: image/jpeg');
header('Expires: ' . date('r', time() + 864000));
header("Pragma: public");
header("Cache-Control: public");
try {
echo $header->read();
} catch (\Exception $e) {
}
exit;
break;
}
......
......@@ -26,13 +26,14 @@ class header implements Interfaces\Api, Interfaces\ApiIgnorePam
$header = new \ElggFile();
$header->owner_guid = $blog->owner_guid;
$header->setFilename("blog/{$blog->guid}.jpg");
$header->open('read');
header('Content-Type: image/jpeg');
header('Expires: ' . date('r', time() + 864000));
header("Pragma: public");
header("Cache-Control: public");
try {
echo file_get_contents($header->getFilenameOnFilestore());
echo $header->read();
} catch (\Exception $e) {
}
exit;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment