List Info

Thread: note 70000 added to function.header




note 70000 added to function.header
user name
2006-09-29 08:46:09
I've been trying to force a download in IE, but everytime it
displayed the MP3 data as text in my IE window. 
None of the suggestions made below worked for me.

I've based the headers on the download of a normal .GIF
file. Here's mine, it's very basic and seems to work on both
IE and FireFox.

<?php
header('HTTP/1.1 200 OK');
header('Date: ' . date("D M j G:i:s T Y"));
header('Last-Modified: ' . date("D M j G:i:s T
Y"));
header("Content-Type:
application/force-download"); // changed to force
download
header("Content-Lenght: " .
(string)(filesize($filelocation)));
header("Content-Transfer-Encoding: Binary"); //
added
header("Content-Disposition: attachment; // added
filename=".str_replace(" ", "",
basename($filelocation)).""); // added to remove
spaces in filename when saving, it seemed to cause some
problems with spaces.
readfile($filelocation);
?>
----
Server IP: 83.137.20.120
Probable Submitter: 86.82.13.3
----
Manual Page -- http
://www.php.net/manual/en/function.header.php
Edit        -- https://master
.php.net/note/edit/70000
Del: integrated  -- h
ttps://master.php.net/note/delete/70000/integrated
Del: useless     -- http
s://master.php.net/note/delete/70000/useless
Del: bad code    -- htt
ps://master.php.net/note/delete/70000/bad+code
Del: spam        -- https:/
/master.php.net/note/delete/70000/spam
Del: non-english -- 
https://master.php.net/note/delete/70000/non-english
Del: in docs     -- http
s://master.php.net/note/delete/70000/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/70000
Reject      -- https://mast
er.php.net/note/reject/70000
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

[1]

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