Mime type detection in ruby via file extension or file content