Hi, i could make my website downloading a pdf files but after downloading i get this error
" There was an error opening this document. the file is damaged and could not be repaired "
i think the problem is in the PDF version because this problem just occur when downloading
pdf files of version 1.4 , but nothing happened when downloading files of version 1.6 ... and this is the code that i used to download pdf files
$DOCUMENT_ROOT=$_SERVER['DOCUMENT_ROOT'];
$dialog_book_name = str_replace(" ","",$book_name);
$root_file = "$DOCUMENT_ROOT"."mysite2/downbooks/";
$down_url = "$root_file$book_name.pdf";
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Description: File Transfer");
header("Content-Type: application/pdf");
header("Content-disposition: attachment; filename=$dialog_book_name.pdf");
header("Content-Transfer-Encoding: binary");
header('Content-Length: ' . filesize($down_url));
readfile($down_url);
exit;
so how to solve this problem with php ... thanks for any help ...