download pdf file using codeigniter code example
Example: view pdf file online without downloading using codeigniter
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');