Edit report at http://bugs.php.net/bug.php?id=53576&edit=1
ID: 53576 Updated by: [email protected] Reported by: husseinwajeeh at gmail dot com Summary: Problem in download pdf files -Status: Open +Status: Bogus Type: Bug Package: PDF related Operating System: Windows 7 PHP Version: 5.2.16 Block user comment: N Private report: N New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. . Previous Comments: ------------------------------------------------------------------------ [2010-12-19 21:39:08] husseinwajeeh at gmail dot com Description: ------------ 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 : Test script: --------------- $DOCUMENT_ROOT=$_SERVER['DOCUMENT_ROOT']; $root_file = "$DOCUMENT_ROOT"."mysite2/downbooks/"; $book_name = str_replace(" ","",$book_name); $down_url = $root_file.$book_name; header('Prgrama: public'); header('Content-Type: application/pdf'); header('Content-Type: application/force-download'); header('Content-Type: application/octet-stream'); header('Content-Type: application/download'); header('Content-disposition: attachment; filename='.$book_name.";"); header('Content-Transfer-Encoding: binary'); header('Content-Length: ' . filesize($down_url)); @readfile($book_name.".pdf"); exit; Expected result: ---------------- download a pdf file Actual result: -------------- i just get a plain text file contains unreadable and unrecognizable words and numbers. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=53576&edit=1
