Expand Cut Tags

No cut tags
topaz: (befuddled)
[personal profile] topaz
At work our end users can download their voicemail from our web site. We use CGI scripts to authenticate them and send them the voicemail message. One user reported last week that he was unable to get either Firefox (Mac) or Safari to play his voicemail.

It appears, from the testing I have done with Firefox on Linux, that if the message type isn't natively supported in the browser -- i.e. the browser has to spawn an external application -- then Firefox essentially ignores the MIME type in the HTTP headers and tries to figure out what to do with the file based on the filename extension in the URL.

Observe:

http://www.unchi.org/~twp/sendjpg.cgi

This is a shell script that prints "Content-Type: image/jpeg" and then displays an image of yours truly. When I go to this URL I get a picture of my shining face.

However:

http://www.unchi.org/~twp/sendwav.cgi

This is a shell script that prints "Content-Type: audio/x-wav" and then sends a .WAV file of Morgan (age 2.5) saying "apple." When I visit this URL, Firefox announces that I am trying to download a file called "sendwav.cgi", which is of type "CGI script," and asks me what application I want to use to open it. No hint that it's an audio file.

Very odd. I can't find any reference to this quickly by Googling. Anyone else ever seen it before? IE appears to do the right thing, ironically enough.

Date: 2005-08-20 06:11 pm (UTC)
From: [identity profile] trom.livejournal.com
Firefox 1.0.3 on OS X 10.4.2 works fine for both. Spawns an inline quicktime player and plays "apple"

Date: 2005-08-20 06:24 pm (UTC)
ext_86356: (Default)
From: [identity profile] qwrrty.livejournal.com
I suspect that's because your browser is configured to use the QuickTime plugin, so it's properly dispatching on the MIME type. I'll investigate further to see if there's something funky about the way we're delivering the voicemails at work that's screwing up the browser -- thanks.

Date: 2005-08-20 07:32 pm (UTC)
From: [identity profile] trom.livejournal.com
I do I do. FWIW that's the default config on os x.

Date: 2005-08-20 07:35 pm (UTC)
From: [identity profile] trom.livejournal.com
Oh and safari unsurprisingly works fine as well. If you want to set me up with a test account, I can check with that as well.

Date: 2005-08-20 06:50 pm (UTC)
From: [identity profile] feste-sylvain.livejournal.com
I'm running Firefox on Linux right here, right now. Sure enough, the CGI which points at your picture immediately shows me your picture.

But the CGI which points me at the WAV file creates a pop-up with the phrase "Opening sendwav.cgi" on the title bar. The text of the pop-up says:

You have chosen to open

sendwav.cgi

which is a: WAV file
from: http://www.unchi.org

What should Firefox do with this file?
  1. Open with [/usr/local/RealPlayer/realplay (default) V]
  2. Save to Disk

[] Do this automatically for files like this from now on.


Then, when I try to play it in RealPlayer, it informs me that it doesn't have the CGI plug-in.

IE does the right thing because it comes automatically pre-bloated.

Date: 2005-08-21 12:04 am (UTC)
From: [identity profile] boutell.livejournal.com
Firefox for Windows plays nice with it.

Date: 2005-08-21 01:38 am (UTC)
From: [identity profile] boutell.livejournal.com
Have you tried just audio/wav? Perhaps Firefox falls back on extension-based guesswork if it doesn't recognize the mime type. And if /etc/mailcap is lame and doesn't have an audio/x-wav entry...

I'm doing your homework on a Saturday night

Date: 2005-08-21 03:50 am (UTC)
From: [identity profile] boutell.livejournal.com
I just reproduced this with Fedora Core 4 and then figured out the why and the wherefore of the thing.

1. You don't have a plug-in installed for audio/x-wav. So Firefox looks for an external player. It does this by checking out good old /etc/mailcap. /etc/mailcap has an entry for audio/*, mapped to "play"... but this entry is commented out, with a note saying that play is apparently a security hole.

2. Firefox gives up and generates a "what would you like to do with this weird shit" message, apparently consulting an internal table of pretty names for various file extensions simply to come up with a more educated guess to help you pick a program. Why it does not consult an internal table of pretty names for common MIME types instead is anybody's guess. However, this does not matter, because...

3. When I uncomment the entry for audio/* in /etc/mailcap, I get an entirely different prompt which correctly recognizes that the file is a WAV file and offers to play it with 'play'.

So: if your system *has* a registered player for audio/x-wav, whether in /etc/mailcap or via a Firefox plug-in (try Plugger, etc), everything will work just fine. You and your end user are only having trouble because Fedora/Red Hat (and perhaps others), in their infinite wisdom, shut off the only default player for audio files in /etc/mailcap without offering any alternative.

Ahhh, that was better than counting sheep! Nighty night now.

Date: 2006-06-11 02:32 pm (UTC)
From: [identity profile] trom.livejournal.com
Incidently, I managed to recreate this problem yesterday. Three things they should try. 1) Open the quicktime system preference, and under advanced->mime hit "use defaults". If that doesn't work they should 2) Reinstall quicktime. They may have to delete the quicktime plugin from /Library/Internet Plug-Ins/. And if streaming audio in general is broken open up /Applications/Utilities/Audio Midi Setup and make sure that output devices are set to 48Khz. Some applications (notoriously Audacity) sometimes reset this to 96Khz.

May 2018

S M T W T F S
  12345
6789101112
13141516171819
20212223242526
27282930 31  

Most Popular Tags

Style Credit

Page generated Jul. 29th, 2025 01:15 pm
Powered by Dreamwidth Studios