Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have this as an error when I try to upload
The selected file FY08-10c.XLS could not be uploaded. The file contents (\012- application/msword) do not match its extension (XLS).
in /etc/mime.types I have the following specified
application/msword doc dot
application/vnd.ms-excel xls xlb xlt
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
Comments
Comment #1
quicksketchThis has been discussed a few times in the MimeDetect module queue. MimeDetect does not properly identify certain files and prevents their uploading. For a quick work-around, you can disable the module and it will permit uploading files through FileField again.
Comment #2
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedI hope this helps someone else
1. I added additional mime-types to /etc/mime.types
application/vnd.ms-word.document.macroEnabled docm
application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx
application/vnd.ms-powerpoint.template.macroEnabled potm
application/vnd.openxmlformats-officedocument.presentationml.template potx
application/vnd.ms-powerpoint.addin.macroEnabled ppam
application/vnd.ms-powerpoint.slideshow.macroEnabled ppsm
application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx
application/vnd.ms-powerpoint.presentation.macroEnabled pptm
application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
application/vnd.ms-excel.addin.macroEnabled xlam
application/vnd.ms-excel.sheet.binary.macroEnabled xlsb
application/vnd.ms-excel.sheet.macroEnabled xlsm
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
application/vnd.ms-excel.template.macroEnabled xltm
application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx
2. with mimedetech still enabled I had to add this to my settings.php file or equivalent as specified in the readme
http://drupal.org/node/306217#comment-2846832
$conf = array(
'mimedetect_magic' => '/usr/share/file/magic',
);