Also good to detect the correct mime type.