Automatically determine mime type of files