http_download headers
| From: | Gema Torm | Date: | Mon, 02 Aug 2004 15:46:03 +0000 |
| Subject: | http_download headers | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-13935@lists.php.net to get a copy of this message | ||
hello,
I´m trying to use http_download, but it tells me headers are already send.
For what I´ve read, it looks like if I set setCache to false, no headers
extra sending will be done, but it doesn´t work as I expect.
I´ve tried also with staticSend.
The only way I could make it work is to insert the download code at the
beginning of the script, but I would´nt like to work this way if possible
because then all the pages in the site will go throuth this code and I only
need it in one page.
Is this possible?
headers send
html...
...
if (!isset($_SESSION['informes']['descarrega'])){
$_SESSION['informes']['descarrega'] = $reg_pdf->PDF;
}
else{
$el_fitxer = $_SESSION['informes']['descarrega'];
unset($_SESSION['informes']['descarrega']);
$dl = &new HTTP_Download();
$dl->setCache('false');
$params = array(
'file' => $el_fitxer,
'contentdisposition' => array(HTTP_DOWNLOAD_ATTACHMENT, 'Asdf.doc'),
);
$dl->staticSend($params , false);
}
Regards,
Gema