Hi all,
I have a database. It receives from my users files - which could be word
documents, Adobe PDF files, text docs, anything...
I store these in a BLOB field of the database.
On a certain page, I include a link to these files which have been saved
into the blob. The link is <a
href="getattachment.php?Fileid=65)">Document</a>.
Now when people link to this (to go to gatattachment.php?fileid=65) the
getattachment does the following:
Finds out the attachment mime type
Sends a:
Header("Content-type: <mime-type>");
Header("Header("Content-Disposition: attachment; filename=\"File65.doc\"" );
Stream the contents of the blob to the browser.
Where the Attachment Filename changes depending on the fileid, and the mime
type (eg. Excel files would be xls)
Now when I click the link, I get garbled content on my browser (no matter
which browser i use - IE, Konqueror, Opera, etc). If I change the headers
to echos, teh I get teh correct results.
What am I doing wrong?
Thanks
David R
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php