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.
Link to comment
Share on other sites

[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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.