php - Failed to open pdf file -


my code working fine. files downloading when open 1 file not opening giving error "error failed load pdf document."

    <?php      $pno = $_get['pno'];      $sql = "select file tenders tno = $id";      $file = "data/" . $mysql_row['file '];     header("content-type:application/pdf");    header("content-disposition:attachment;filename='downloaded.pdf'");    readfile($file);    ?> 

$file = "path_to_file"; $fp = fopen($file, "r") ;  header("cache-control: maxage=1"); header("pragma: public"); header("content-type: application/pdf"); header("content-disposition: inline; filename=".$myfilename.""); header("content-description: php generated data"); header("content-transfer-encoding: binary"); header('content-length:' . filesize($file)); ob_clean(); flush(); while (!feof($fp)) {   $buff = fread($fp, 1024);   print $buff; } exit; 

Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -