Page 1 of 1

how to set headers for sending binary files?

Posted: Thu Apr 30, 2009 1:18 pm
by bignose
Hi,

I have a action in a custom module, if a certain paramater is set, it should send the content as a PDF file, if its not set it shows $this->ProcessTempate

Of course right now if i run it with the pdf part.. it just shows the binary garble inside of my template in the body section...

Wondering how i pre-empt the tempalte, and the html/text header and all that fun stuff?


Thanks

Re: how to set headers for sending binary files?

Posted: Mon May 04, 2009 6:51 pm
by Jeff
Is it too late to do a header_redirect to the pdf file?

Re: how to set headers for sending binary files?

Posted: Mon May 04, 2009 6:53 pm
by bignose
Not sure, what I ended up using was ob_clean() to delete all previous info in the buffer, then send fresh headers.