instead of displaying a pdf file, the entire file code is being printed on the screen... how do i fix this???
Code: Select all
<?
header ("Content-Type: application/pdf");
$a = mysql_query($query);
$blah = mysql_fetch_assoc($a);
$case = $blah["caseaddress"];
echo " - case - ";
echo $case;
$case = $path.$case;
$chunksize = 1*(1024*1024); // how many bytes per chunk
$buffer = '';
$handle = fopen($case, 'r+b');
if ($handle === false)
{
return false;
}
while (!feof($handle))
{
$buffer = fread($handle, $chunksize);
print $buffer;
}
return fclose($handle);
?>feyd | Please use
Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]