title: Detect MIME type of uploaded file in Ruby
body: <p>Is there a bullet proof way to detect MIME type of uploaded file in Ruby or Ruby on Rails? I'm uploading JPEGs and PNGs using SWFupload and <code>content_type</code> is always <code>"application/octet-stream"</code></p>