Re: HTTP_Download strange output
| From: | Elliot Larson | Date: | Wed, 24 Mar 2004 09:46:58 +0000 |
| Subject: | Re: HTTP_Download strange output | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-11465@lists.php.net to get a copy of this message | ||
Okay, so, oddly this problem resolved itself when I restarted my computer.
There must have been some IE glitch that rebooting resolved. Uhhhgg...
Microsoft the Lame strikes again.
I encountered another issue, however. When I link to a page using the code
below, the code executes fine and the download prompt appears as expected,
but then if I choose to download I am stuck with a blank page when the
download is complete. I can't redirect to another page or echo out some
friendly html because headers have already been sent.
Does anyone have any suggestions on how to allow the download page to
display some user friendly HTML after the download has completed?
Elliot
"Elliot Larson" <elliot@onehouse.net> wrote in message
news:001501c4112b$00370c10$0301a8c0@Linus...
Hello Mike,
I am trying to use the HTTP_Download class, and instead of getting a file
for download when I execute my code I am getting some strange output, like
the following:
4F\c=t~?Õz4mi®<Äf?xð-âÁC<Äf?xð-âÁC<Äf?xð-âÁC<~ö
_____
Fe4 endstream endobj 3026 0 obj<> endobj 3027 0 obj<<< PieceInfo<< 53
Metadata 55 StructTreeRoot 50 PageLabels Catalog Type 17
I am using the following code to attempt to download the file:
<?php
require_once("HTTP/Download.php");
$file = "../docs/15/doc.pdf";
$dl =& new HTTP_Download();
$dl->setFile($file);
$dl->setContentDisposition(HTTP_DOWNLOAD_ATTACHMENT, 'download');
$dl->setContentType('application/x-octetstream');
$dl->send();
?>
I have tried setting the content type to text/html, application/pdf, and
application/x-download, but to no avail.
Do you have any idea what I might be doing wrong?
Elliot