Page 1 of 1

ie6 and apache and m3u files

Posted: Wed Jun 23, 2004 5:10 pm
by pwrlogic
hello
my website http://www.newblackmusic.net
streams mp3 and real audio files using m3u or ram files
everything works except in internet explorer. when i use apples's safari or opera, the downloaded clip will have the .m3u or . ram extension but when i use IE the downloaded clip has the .php extension
i have added entries to the mim types file and the conf file
i'm using the easyphp apache install.
why would it work on everything but IE.
since i have deamweaver on my machine the .php files open in dreamweaver. i tried it on another machine that did not have dreamweaver or any php editor on it . the files had the .php extension but the correct audio player opened and played the mp3 file or real audio file.
this is the 3rd day on this
any help would be really appreciated

Posted: Wed Jun 23, 2004 5:24 pm
by feyd
with IE, you have to tell it exactly what filename to use we have several threads about forcing downloads and how to set up the headers, you can research the [php_man]header[/php_man]() function for details too.

Posted: Wed Jun 23, 2004 5:48 pm
by pwrlogic
here is my code which includes header
if (isset($submit1_x)) header("location: http://www.newblackmusic.net/songname.m3u");
should'nt this work

Posted: Wed Jun 23, 2004 6:03 pm
by feyd
I use this for forcing-downloads

Code: Select all

<?php
		$file = "songname.m3u"; // the file you wish to send
		$mime = "text/m3u"; // or whatever it is
		$saveas = "somefilename.m3u"; // the default filename their computer will save it as

		header("Cache-Control: no-store, no-cache, must-revalidate");
		header("Cache-Control: post-check=0, pre-check=0",false);
		header("Pragma: no-cache");
		$filesize = filesize($file);
		header("Content-type: {$mime}");
		header("Content-length: {$filesize}");
		header("Content-disposition: attachment; filename={$saveas}");
		header("Content-Transfer-Encoding: binary");
 		readfile($file);
 		exit();
?>
oops.. forgot to change the mime part in the actual code.. fixed.

ok i'll try it

Posted: Wed Jun 23, 2004 6:13 pm
by pwrlogic
all that code just for IE6
i dont know but i'll try it
thanks

Posted: Wed Jun 23, 2004 6:14 pm
by feyd
it's for all browsers.