Bug #53576 [Opn->Bgs]: Problem in download pdf files
| From: | johannes@php.net | Date: | Sun, 19 Dec 2010 23:46:30 +0000 |
| Subject: | Bug #53576 [Opn->Bgs]: Problem in download pdf files | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-157093@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=53576&edit=1
ID: 53576
Updated by: johannes@php.net
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