Hi,
I am getting some problem to open the pdf file which is downloaded via PHP header.After download when I try to open this Its give me the error like
"Adobe could not open this file either its not supported or file has been demaged it was sent as an email attachment and was not correctly decoded"
Can any body help me.
The code I am using that is:
<?php
include "connection.php";
$tableName=" tbl_time_table,tblclass,tbladditionalinfo ";
$fields="tb_code,c_desc,date_format(tb_date,'%d-%m-%Y') as myDate,class_code_fk,note,ad_userlogin";
$filter="class_code_fk='$classes' and class_code_fk=c_id and tb_date='$date' and ad_id='$user_id' and prepared_by_employee_code='$user_id'";
$gotten =$dbObject->select_Records_Feilds_Filter($tableName, $fields, $filter);
$row = mysql_fetch_array($gotten);
$bytes = $row['c_desc'];
header("Content-type: application/pdf");
header('Content-disposition: attachment; filename="thing.pdf"');
readfile('thing.pdf');
?>