|
|||
|
Hi -
public function indexAction() { ... $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(); $this->getResponse()->renderExceptions(true); $this->getResponse()->setHeader('Content-Type', 'image/jpeg'); $this->getResponse()->setBody($myobject->imageBlob); $this->getResponse()->sendResponse(); } I'm trying to return a binary image stream as the result of my action. I see the image data, but it has two characters prepended on the front of the data. I can get the same database/data to work when I have a simple .php file retrieve the data from the database and return it, but when I do it as an action, there is still some stuff being injected at the front that I can't seem to turn off... Any ideas? Thanks! Tim |
|
||||
|
Not that your way won't work, but what I have done in my apps is make the view script echo out the header and image Blob data. The controller gets it and assigns it to the view and the view script is returned as an image.
__________________
Zend Framework Resources: Zend Webinars | Reference Manual | API Docs | Books | FreeNode: #zftalk Getting Started Tutorials: Getting started with ZF | Getting started with Zend Auth |
|
|||
|
Hmm, that's actually what I tried originally:
$this->_helper->layout->disableLayout(); $this->getResponse()->setHeader('Content-Type', 'image/jpeg'); And then: <?php echo $this->myobject->myblob ?> I see the data, but it still has extra stuff on it. Tim |
![]() |
| Thread Tools | |
| Display Modes | |
|
|