Did you try with $this->getResponse()->setBody($image['data']); ?
I don't know if it will work but maybe will do the trick :)

Giuliano

Michael Crumm wrote:
> 
> 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
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Outputting-an-image-tp20132978p20150164.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to