Jump to content


Photo

Different browsers and different MIME types


  • Please log in to reply
6 replies to this topic

#1 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 01 October 2006 - 08:48 PM

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.
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/

#2 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 01 October 2006 - 09:55 PM

yeah I have had the same issue. the only other differences I've noticed up to now is certain images being prepended with a 'p' on IE for example image/pjpeg instead of image/jpeg
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!

#3 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 02 October 2006 - 05:40 AM

Hmmm, makes it annoying to check filetypes. That makes us having to depend on the extension I guess.

#4 neylitalo

neylitalo
  • Staff Alumni
  • Advanced Member
  • 1,854 posts
  • LocationMichigan, USA

Posted 02 October 2006 - 05:46 AM

Hmmm, makes it annoying to check filetypes. That makes us having to depend on the extension I guess.


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.
http://nealylitalo.net - My personal website, and home of The Netizen's Journal.

#5 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 02 October 2006 - 05:50 AM

mime_content_type might help, but it requires that special file.

#6 neylitalo

neylitalo
  • Staff Alumni
  • Advanced Member
  • 1,854 posts
  • LocationMichigan, USA

Posted 02 October 2006 - 12:49 PM

good eye, I hadn't noticed that one - I think that'll solve effigy's problems.
http://nealylitalo.net - My personal website, and home of The Netizen's Journal.

#7 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 02 October 2006 - 03:22 PM

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.
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users