ie6 and apache and m3u files

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
pwrlogic
Forum Newbie
Posts: 3
Joined: Wed Jun 23, 2004 5:10 pm
Location: new york
Contact:

ie6 and apache and m3u files

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
pwrlogic
Forum Newbie
Posts: 3
Joined: Wed Jun 23, 2004 5:10 pm
Location: new york
Contact:

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
Last edited by feyd on Wed Jun 23, 2004 6:16 pm, edited 1 time in total.
pwrlogic
Forum Newbie
Posts: 3
Joined: Wed Jun 23, 2004 5:10 pm
Location: new york
Contact:

ok i'll try it

Post by pwrlogic »

all that code just for IE6
i dont know but i'll try it
thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

it's for all browsers.
Post Reply