note 77478 added to function.header
| From: | mortengrigoriATgmail dot com at osu1 dot php dot net | Date: | Fri, 31 Aug 2007 02:43:17 +0000 |
| Subject: | note 77478 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-129924@lists.php.net to get a copy of this message | ||
Hello, I've being facing a problem using the "Content-Disposition" parameter, every I
download a file the whole content of the page from where I download the file is "attached"
to the end of the file.
Follows the routine I've been using:
if (isset($_GET['download']) && ($_GET['download'] >= 1)) {
if ($_GET['download'] == 1)
header('Content-type: application/doc');
else if ($_GET['download'] == 2)
header('Content-type: application/rtf');
else if ($_GET['download'] == 3)
header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="' . $_GET['file'] .
'"');
readfile($_GET['file']);
}
Does anyone know a workaround? All the research I've done gave no answer.
Thanx in advance.
----
Server IP: 69.147.83.197
Probable Submitter: 201.25.233.80
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit -- https://master.php.net/note/edit/77478
Del: integrated -- https://master.php.net/note/delete/77478/integrated
Del: useless -- https://master.php.net/note/delete/77478/useless
Del: bad code -- https://master.php.net/note/delete/77478/bad+code
Del: spam -- https://master.php.net/note/delete/77478/spam
Del: non-english -- https://master.php.net/note/delete/77478/non-english
Del: in docs -- https://master.php.net/note/delete/77478/in+docs
Del: other reasons-- https://master.php.net/note/delete/77478
Reject -- https://master.php.net/note/reject/77478
Search -- https://master.php.net/manage/user-notes.php