Jump to content

Archived

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

effigy

Different browsers and different MIME types

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.

Share this post


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

Share this post


Link to post
Share on other sites
Hmmm, makes it annoying to check filetypes. That makes us having to depend on the extension I guess.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
[url=http://php.net/mime_content_type]mime_content_type[/url] might help, but it requires that special file.

Share this post


Link to post
Share on other sites
good eye, I hadn't noticed that one - I think that'll solve effigy's problems.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

×

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.