RE: [PEAR] HTTP_Download strange output
| From: | Mike Carter | Date: | Wed, 24 Mar 2004 09:01:14 +0000 |
| Subject: | RE: [PEAR] HTTP_Download strange output | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-11463@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Elliot Larson [mailto:elliot@onehouse.net]
>
> 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˜€Õž4mi®<ă‡xð‑âÁC<ă‡xð‑âÁC<ă‡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?
Well the strange output is obviously the actual content of the file, maybe containing some macro
type scripting in it as well?
Problems that could cause this... Hmm, output to the client browser before PHP has sent its headers
containing the content-type maybe?
- Mike C.
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________