Completed fix related to detecting mime type by file when content-type is not set.