Fix a problem when Python could not determine file mime type by extension.
In this case the mime type will be generic 'application/octet-stream'.