Link to home
Start Free TrialLog in
Avatar of Jaycee
Jaycee

asked on

header('Content-Disposition: attachment; filename="jaycee.m3u"');

Hello,

I have a tiny problem.

I am generating a m3u file, that I want IE to open it, without having IE ask me to open or download it. (Always Ask .. option is grayed out).
Here is the files:

stream.php:
<?php
header("Content-type: audio/x-mpegurl"); // tested without "x-" as well.
header('Content-Disposition: attachment; filename="jaycee.m3u"');
echo "#EXTM3U\n";
?>

jaycee.m3u (generated):
#EXTM3U


If I download the generated file, put it on the web server, and try to download it directly, the option is available, and I am able to listen the file without having to confirm the opening.

So, I beleive that IE doesn't like opening a php, and having the server returning otherwise. (May I wrong?)

Does anyone have an idea to deal with this ?
(otherwise that add m3u file as php extension and rename my stream.php in stream.m3u)

Thanx for your help.


Jaycee.
SOLUTION
Avatar of Roonaan
Roonaan
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Have you compared the headers send by the webserver when using the .mu3-file directly or when using the stream.php ? try it with a network sniffer on your client  so you might see whats different.
Avatar of Jaycee
Jaycee

ASKER

Roonaan : Doesn't work ... (just tried.. ) but thanx for your reply...

Hernst42: I just tested with fiddler. the only major difference is the content-disposition in the header...  (and a X-Powered by php, but I beleive this is not relevant ... ).

I tryed removing the content-dispo, the phpfile is opened correclty, but this is not the behaviour I need ...

Hum, it seems that according to this: http://support.microsoft.com/kb/q182315/
it would be impossible ...

any trick ? or should I stop php and become a plumber ?

hernst42, btw, thank you for your reply too .. :)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jaycee

ASKER

Guys,

I found the problem (which is, obviously not a problem, but a feature)...
according to http://http://www.nic.mil/ftp/rfc/rfc2183.txt a browser MUST ask the user to open or download a file if a ( content-disposition : attachement ) header is provided.

I will split the points since you all tried to find a solution .

Thank you for your support.