Mime types.. when will people learn?

HTTP has an incredible useful feature to supply the Content-Type HTTP header for any url. This allows HTTP clients to easily figure out what type of data they're getting.

Over and over again I see clients, not doing this and making assumptions based on the url. The extension of all things! This is some artifact inherited from ms-dos, and passed on to different operation systems when GUI's became popular.

Two clear examples I have today (and I'm sure many people will have examples like this)

  • Flash's VideoPlayer component. If there's no extension in the url, it will assume its some kind of xml file.
  • iTunes podcasts.. Files have to end with a known extension for iTunes to pick it up as a video or audio file. Even though the Mime type has to be specified in both the RSS feed and the HTTP Header!

WTF?


4 Responses to Mime types.. when will people learn?

  1. 514 Jim 2008-01-10 8:36 pm

    Shouldn't you be raving about Windows... or Mac? I am not sure about your OS, but using Linux a file with .dsakxklf will still be labeled as a video and associated with it's player as long as the video's type is correct. The issue is when there is no extension and no file type.

  2. 515 Evert 2008-01-10 8:40 pm

    That might be true, and that would also work for OS/X (where I'm on..). If something doesn't have that mark (on Linux or OS/X) the extension will however be used to determine a filetype..

    My rant wasn't really about the operation systems, but more about HTTP client implementors such as Apple and Adobe in this case..

  3. 517 sapphirecat 2008-01-11 12:52 pm

    Amen on the VideoPlayer thing. To get around that once, I had to write a URL like this: video.php?get=VIDEOID&hack=x.flv

    Ick.

  4. 516 Disher 2008-01-11 2:23 pm

    Pain in the ass!



About

My name is Evert, and I've been writing semi-regularly on this blog since 2006.

I'm currently available for contract work.

more info.

Subscribe

Dropbox

Dropbox is a simple cross-platform online backup and sync application. The first 2GB of space is free, and both you and me get an extra 250MB extra space if you sign up through this link.