07-01-2009, 12:33 PM
[eluser]sl3dg3hamm3r[/eluser]
Hey there
I use R&OS; and I am stumbling over a problem. Unfortunately, I couldn't find any contact-address on the web-page, therefore I hope somebody here solved it already.
I set the headers as follow:
Basically, it will prevent caching, the browser would pop up a nice save or open dialog, and the pdf gets a nice name.
This works, until the pdf-class needs to generate another page due to long (dynamic) contents. Then it seems that I loose the headers, the pdf opens within the browser, no nice name when I want to save it.
I looked for any echo-statements in the pdf-class, nothing.
Has anybody encountered this before?
Thx for any tipps, if any...
Oliver
Hey there
I use R&OS; and I am stumbling over a problem. Unfortunately, I couldn't find any contact-address on the web-page, therefore I hope somebody here solved it already.
I set the headers as follow:
Code:
$this->CI->output->set_header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // some day in the past to avoid cached files
$this->CI->output->set_header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
$this->CI->output->set_header("Content-type: application/pdf"); // It is a pdf...
$date = gmdate("d.m.Y") . "_" . date("H_i");
$this->CI->output->set_header("Content-Disposition: attachment; filename=".$fileName."_".$date.".pdf");
$this->CI->output->set_header("Content-Transfer-Encoding: binary");
Basically, it will prevent caching, the browser would pop up a nice save or open dialog, and the pdf gets a nice name.
This works, until the pdf-class needs to generate another page due to long (dynamic) contents. Then it seems that I loose the headers, the pdf opens within the browser, no nice name when I want to save it.
I looked for any echo-statements in the pdf-class, nothing.
Has anybody encountered this before?
Thx for any tipps, if any...
Oliver