download pdf files automatically code example
Example: view pdf file online without downloading
header("Content-Length: " . filesize ('theme/assets/pdf/ci.pdf' ) );
header("Content-type: application/pdf");
header("Content-disposition: inline;
filename=".basename('theme/assets/pdf/ci.pdf'));
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
$filepath = readfile('theme/assets/pdf/ci.pdf');