autodetect mime type