Jump to content

Different browsers and different MIME types


effigy

Recommended Posts

I've returned to some old upload code of mine and I noticed something awkward about the MIME types. Using the same server, code, file (an mp3)--the same everything except the browser--I get different MIME types:

IE and Netscape see the file as audio/mp3.
Opera sees the file as audio/mpeg.
FF sees the file as application/x-octet-stream.

FF is the deviant here. Has any one seen this before?

Thanks.
[quote author=Daniel0 link=topic=110170.msg445031#msg445031 date=1159767638]
Hmmm, makes it annoying to check filetypes. That makes us having to depend on the extension I guess.
[/quote]

Which is almost as useless as not checking filetypes at all, unfortunately. If your script is going to be published on a *nix system, then you might be able to find a way to use exec or passthru to run file on the uploaded file, but that'll only work if a) safe_mode is off, or b) safe_mode_exec_dir allows you to run programs in /usr/bin, or wherever file is located on that particular host. Which is rather unlikely.
I'll try it out and report back (Apache also has a mod_mime_magic). I'm still puzzled why the server's MIME configuration does not override the browsers. I have the standard mime.types file which specifies that mp3 extensions are of audio/mpeg, which matches the RFC.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.