I have a script which reads in .pdf files based on user input. here is the script
<?php
header("Content-type: application/pdf");
header("Content-disposition: inline; filename=$filedata.pdf");
header("Content-length: " . filesize("$filedata.pdf"));
$fd = fopen("$filedata.pdf", "r");
fpassthru($fd);
fclose($fd);
?>
I have all of my files stored in one directory, is there a way to secury this directory against browsing as well as the files inside? i would like to limit access to the files unless the script is run. So is there a way to change permissions in the actual script such as with chmod?
thanks