Welcome Guest, Not a member yet? Register   Sign In
pdf file opening problem
#1

[eluser]Star123[/eluser]
Hi,
After downloading pdf file using php script and while opening that pdf file will occurs following error



"There was an error opening this document.The file damaged and could not be repaired "

$name=$this->paymentmodel->buydoc1($id,$this->userid);
$buydoc=$this->paymentmodel->buydoc($id,$this->userid);//path
$file_ext= strtolower(substr($name, strrpos($name, '.') + 1));
header("Content-type: application/$file_ext");
header("Content-Disposition: attachment; filename=$name");
readfile(base_url().$buydoc);
$this->load->view('buydocument',$data);

Does not open the pdf file after the pdf file downloaded .
But other types of file can open(such as doc,jpg and etc..)after fille download
Please help me




Theme © iAndrew 2016 - Forum software by © MyBB