Added a check to use the file attachment header if the mime type is octet-stream