Forum Moderators: open
The problem is that Mac browsers don't handle the content-type correctly (audio/x-mpeg), and it tries to download the ASP page instead.
Is there a work-around for this?
Mac browsers don't handle the content-type correctly (audio/x-mpeg), and it tries to download the ASP page instead.
Explain how that is not "correct"?
Probably the best way to get the desired result would be to generate a "m3u" or "pls" file which the browser can download and pass to the configured player. If your webpage can link to the file (to cause it to be downloaded), then you have a URL for it to place in the .m3u/.pls file.
Explain how that is not "correct"?
If you explicitly assign a content-type to the page, the browser should take action accordingly.
i.e.
I tell the browser that the page's content-type is audio/x-mpeg, and I tell the browser (via content-disposition) that the filename is c:\somewhere\something.mp3. It should then know to open the file via the system's default application to play mp3 files.
It would be a different story if I specified the content-type as text/html, and the content-disposition as test.asp, but that's not the case. So the browser shouldn't try to download my test.asp file.
Am I missing something?
Edit:
I will make it a little more clear: Mac browsers are trying to download the physical ASP file, like it was an attachment. Opera, IE, Netscape all handle the mp3 file correctly, and stream it.
I'm using an ASP file to dynamically stream an m3u file:
Response.ContentType = "audio/x-mpegurl"
Response.AddHeader "Content-disposition", "filename=audio_stream" & intFileID & ".m3u"
Response.Write "#EXTM3U" & vbCrLfResponse.Write "#EXTINF: 0," & rs("bandname") & " - " & rs("title") & vbCrLf
Response.Write "http://www.example.com/audio_standard/audio_standard.mp3?file_id=" & intFileID
When I try this on IE 6, Opera 7.53, even Netscape 6.2, it works fine. But if I try it on a Mac, it tries to download my ASP file, not the m3u file listed in the content-disposition.
I am aware of the "attachment" thing... It's actually "inline" for my purposes, I just didn't bother to post the correction to drbrain.
As for the content handler-
x-mpegurl is the standard content-type for an M3U file. I have iTunes installed on the Mac, which covers that base.
Please keep the ideas coming :)