Try moving the header addition line to after the flush statement.

Regards,

Jie 

* AndrĂ© Warnier (tomcat) <[email protected]> wrote:

> Date: Tue, 7 Feb 2017 02:40:44 +0100
> From: "AndrĂ© Warnier (tomcat)" <[email protected]>
> To: [email protected]
> Subject: Re: Flush headers ?
> User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:38.0) Gecko/20100101
>  Thunderbird/38.5.0
> 
> On 06.02.2017 18:33, Ben RUBSON wrote:
> >Hi,
> >
> >I'm using mod_perl2 and I'm trying to flush headers before the body content.
> >
> >$r->content_type('application/zip');
> >$r->headers_out->add('Content-Disposition' => 'attachment');
> >$r->rflush;
> >long_operation();
> >
> >Unfortunately this does not work.
> 
> When you say "this does not work", can you be more explicit ?
> If you trace the browser request/response headers, what does it show exactly ?
> 
> >
> >The following works, but of course corrupts my output :
> >
> >$r->content_type('application/zip');
> >$r->headers_out->add('Content-Disposition' => 'attachment');
> >print "\0";
> >$r->rflush;
> >long_operation();
> >
> >Any clue ?
> >
> >Many thanks !
> >
> >Ben
> >
> 

Reply via email to