Hi, i have a problem in downloading pdf files that is when i click the download button it just download a text file contains unreadable and unrecognizable words and numbers , so can any one help me to solve this problem
my code to download a pdf file is :
$DOCUMENT_ROOT=$_SERVER['DOCUMENT_ROOT'];
$root_file = "$DOCUMENT_ROOT"."mysite2/downbooks/";
$down_url = $root_file.$book_name.".pdf";
header('Content-Type: application/force-download');
header('Content-Type: application/octet-stream');
header('Content-Type: application/download');
header('Content-disposition: attachment; filename='.basename($down_url)."'");
header('Content-Type: application/pdf');
header('Content-Transfer-Encoding: binary');
//header('Content-Length: ' . filesize($down_url));
@readfile($down_url);
exit(0);