Get the file extension and MIME type from a file