[nycphp-talk] readfile() with PDF
Kristina Anderson
ka at kacomputerconsulting.com
Sun Jun 1 18:43:58 EDT 2008
Hi Everyone --
I'm almost there with my PDF download application and everything is
working great except that instead of downloading the PDF, it's printing
it out on the screen like so:@8(µr;q®ª7èLöy¥&Qëñq¶4±j½ç|æ9ÚÄ
V³)gB£0ñiW×8#©8wÕ©õ8_Å٥ʨQãüÜ«QÊj@é&»A)/ÇÙgº>'KóÈtÕ;\ú
Ó¥$ÕºF½ZUnÀÜå
(4T%)ë«0C&¯é¤Z£i¿ó8¦ÚbxE¡ÁÁBÑ;
ú¯¿P¦ÞÎÓ̹Aü om?çW= x¯Íú·¶Ò-¯Àòæ[Ëû0ñ¾
¾øÎ}ø¦y)
7ta¾¾õõõ>j¥ÜÇTÐ7ú¿@ï¼ÏÇtÜò`qÊ2±Êê&¯®ª6ê etc.
Here is the code that I have right now...something is wrong. At one
point I got it to give me the file save/download dialogue box but with
the pagename not the filename...
//=======
$filename="333.pdf";
$filesize=filesize($filename);
header("Content-Type: application/pdf");
header("Content-Length: ".$filesize);
header("Content-Disposition: inline; filename=$filename");
header("Content-Transfer-Encoding: binary");
$file_contents = readfile($filename);
print $file_contents;
//======
-- Kristina
More information about the talk
mailing list