Hello all,
I seem to be unable to output an image to the browser via a zf controller
action. relevent code follows.
public function viewAction()
{
$this->_helper->layout->disableLayout();
$this->_helper->ViewRenderer->setNoRender();
if (!$id = $this->_getParam('id', false)) {
return $this->_helper->redirector('index');
}
$model = $this->getModel();
$image = $model->get($id);
$this->_response->setHeader('Content-Type', 'image/jpeg', true);
echo $image['data'];
}
As you can see, when the action is called (with a valid id parameter), i
just want the browser to spit out the image. Instead, i'm getting no output
at all.
I have using readfile() and pointing to a absolute filesystem path as well,
also with no luck.
The data appears to be downloading - firebug shows the actual image sizes
being downloaded
Does anyone have any thoughts?
Michael Crumm