I am working on a script that requires a user to enter an e-mail address and a name before they can access some requested files. If the user is a first time visitor the page displays a form. After entering the information in the form the user is then allowed to view the files. Two of the files are pdf files (1MB and 3M and I am using the following method to access them:
$file = "/var/tmp/filename.pdf";
header ("Content-disposition: inline; filename=" . basename($file));
header ("Content-type: application/pdf");
header ("Content-length: " . filesize($file));
readfile($file);
On the inital login of the user all files are able to be seen just as they should. The problem however is after the user closes their browser and wishes to return to the page. The information the user entered on the inital visit is stored in a cookie and is retrieved from the cookie each time the user visits after the inital visit. When doing this and trying to view the files only the PDF file that is 3mb or larger is unable to be accessed. One other note to add is that if the first file accessed when returning to the site is the PDF less than 3mb or the other file which is a php page and then the file that is 3mb or larger is tried it then loads without a hitch.
I am looking for any suggestions please.