Last modified: 2014-07-04 17:03:59 UTC
When attempting to upload a CSV file, MediaWiki throws the following error: "File extension ".csv" does not match the detected MIME type of the file (text/plain)." This forces the user to change the file extension from ".csv" to ".txt" in order to store this file in the wiki, which is incorrect Tested with CSV from various programs, including Microsoft Excel export.
From which operating system is the csv file uploaded?
Tried this on both Mac OS X (10.8) with chrome and Windows 7 with firefox.
(In reply to comment #2) > Tried this on both Mac OS X (10.8) with chrome and Windows 7 with firefox. Its matters more what os your server is as file type detection is done on the server side. (Sometimes mw uses the underlying os for file type detection. Im not sure what the default is off the top of my head) Mw hasnt overly been tested with file formats other than standard image formats so its probably just an oversight. (As quick hack work arround - if its important to make this work quickly you could change csv to be associated with text/plain in includes/mime.types . Obviously that is not a proper fix)
(In reply to comment #3) The host machine is running Debian Linux 6.0.6 (aka squeeze) and php 5.4.10
have the same issue with Windows 2012. as well as File extension ".xlsx" does not match the detected MIME type of the file (application/vnd.ms-excel). File extension ".docx" does not match the detected MIME type of the file (application/msword).
docx is application/vnd.openxmlformats-officedocument.wordprocessingml.document xlsx is application/vnd.openxmlformats-officedocument.spreadsheetml.sheet http://technet.microsoft.com/en-us/library/ee309278%28office.12%29.aspx
Change 141765 had a related patch set uploaded by Brian Wolff: Fix mime detection of easily-confused-with text/plain formats https://gerrit.wikimedia.org/r/141765
Change 141765 merged by jenkins-bot: Fix mime detection of easily-confused-with text/plain formats https://gerrit.wikimedia.org/r/141765
This should be fixed on mediawiki 1.24