file extension is set depending on the mime type