how to set headers for sending binary files?

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
bignose
New Member
New Member
Posts: 3
Joined: Thu Sep 04, 2008 2:35 pm

how to set headers for sending binary files?

Post 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
Jeff
Power Poster
Power Poster
Posts: 961
Joined: Mon Jan 21, 2008 5:51 pm
Location: MI

Re: how to set headers for sending binary files?

Post by Jeff »

Is it too late to do a header_redirect to the pdf file?
bignose
New Member
New Member
Posts: 3
Joined: Thu Sep 04, 2008 2:35 pm

Re: how to set headers for sending binary files?

Post by bignose »

Not sure, what I ended up using was ob_clean() to delete all previous info in the buffer, then send fresh headers.
Post Reply

Return to “Developers Discussion”