List Info

Thread: note 77478 added to function.header




note 77478 added to function.header
user name
2007-08-30 21:43:17
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  -- h
ttps://master.php.net/note/delete/77478/integrated
Del: useless     -- http
s://master.php.net/note/delete/77478/useless
Del: bad code    -- htt
ps://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     -- http
s://master.php.net/note/delete/77478/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/77478
Reject      -- https://mast
er.php.net/note/reject/77478
Search      -- https://
master.php.net/manage/user-notes.php

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


note 77478 rejected from function.header by cece
user name
2007-08-31 06:54:21
Note Submitter: mortengrigori AT gmail.com 

----

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.

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )