file_get_contents solved my problem. Many thanks Matthew.
Good to know that my code regarding response object was correct.

On Fri, Oct 19, 2012 at 11:25 PM, Matthew Weier O'Phinney
<matt...@zend.com> wrote:
> -- Steve Rayner <srayne...@googlemail.com> wrote
> (on Friday, 19 October 2012, 09:33 PM +0100):
>> Can anyone point me to an example of how to correctly set response
>> headers using ZF2?
>> My code here does not work; http://pastie.org/5085542
>
> I've set headers exactly that way just this week; it works.
>
> The problem in there is the readfile() statement. We do not enable any
> output buffering by default, which means that readfile is immediately
> sending the data, and your headers never have a chance to get sent.
>
> You _may_ be able to pass a stream resource to setContent(); otherwise,
> you'll need to either (a) use file_get_contents() and pass that to
> setContent(), or (b) capture the output buffer and pass the value to
> setContent().
>
> --
> Matthew Weier O'Phinney
> Project Lead            | matt...@zend.com
> Zend Framework          | http://framework.zend.com/
> PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
>
> --
> List: fw-general@lists.zend.com
> Info: http://framework.zend.com/archives
> Unsubscribe: fw-general-unsubscr...@lists.zend.com
>
>

-- 
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com


Reply via email to