I am unable to stream a pdf when I use session_start().
If I comment the session_start it works . Otherwise when acrobat
opens it tells me that it is unable to open the file. I guess the session data is corrupting the strreamed file. But how can I protect the download if I cannot check the user???
<?php
//session_start();
include "end/html/htmllib.php";
$billId = intval(substr(Html::get("billId","GET","0"),0,10));
$filename = "c:/ebill/bills/$billId.pdf";
if (file_exists($filename) && $billId !=0)
{
header("Content-type: application/pdf");
header("Content-Disposition: attachment;
filename=$billId.pdf");
readfile($filename);
}
else
{
die ("FAILED");
}
?>