effigy Posted October 1, 2006 Share Posted October 1, 2006 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 Link to comment https://forums.phpfreaks.com/topic/22683-different-browsers-and-different-mime-types/ Share on other sites More sharing options...
redbullmarky Posted October 1, 2006 Share Posted October 1, 2006 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 Quote Link to comment https://forums.phpfreaks.com/topic/22683-different-browsers-and-different-mime-types/#findComment-102006 Share on other sites More sharing options...
Daniel0 Posted October 2, 2006 Share Posted October 2, 2006 Hmmm, makes it annoying to check filetypes. That makes us having to depend on the extension I guess. Quote Link to comment https://forums.phpfreaks.com/topic/22683-different-browsers-and-different-mime-types/#findComment-102139 Share on other sites More sharing options...
neylitalo Posted October 2, 2006 Share Posted October 2, 2006 [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. Quote Link to comment https://forums.phpfreaks.com/topic/22683-different-browsers-and-different-mime-types/#findComment-102141 Share on other sites More sharing options...
Daniel0 Posted October 2, 2006 Share Posted October 2, 2006 [url=http://php.net/mime_content_type]mime_content_type[/url] might help, but it requires that special file. Quote Link to comment https://forums.phpfreaks.com/topic/22683-different-browsers-and-different-mime-types/#findComment-102144 Share on other sites More sharing options...
neylitalo Posted October 2, 2006 Share Posted October 2, 2006 good eye, I hadn't noticed that one - I think that'll solve effigy's problems. Quote Link to comment https://forums.phpfreaks.com/topic/22683-different-browsers-and-different-mime-types/#findComment-102269 Share on other sites More sharing options...
effigy Posted October 2, 2006 Author Share Posted October 2, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/22683-different-browsers-and-different-mime-types/#findComment-102385 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.