Last modified: 2014-07-04 17:03:59 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T47424, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 45424 - CSV files are recognized as "text/plain" and cannot be uploaded with the .csv file extension
CSV files are recognized as "text/plain" and cannot be uploaded with the .csv...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
1.20.x
PC Linux
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-26 16:50 UTC by Andrew Kongs
Modified: 2014-07-04 17:03 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Andrew Kongs 2013-02-26 16:50:22 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.
Comment 1 Andre Klapper 2013-02-26 19:48:05 UTC
From which operating system is the csv file uploaded?
Comment 2 Andrew Kongs 2013-02-26 21:10:24 UTC
Tried this on both Mac OS X (10.8) with chrome and Windows 7 with firefox.
Comment 3 Bawolff (Brian Wolff) 2013-02-26 22:22:51 UTC
(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)
Comment 4 Andrew Kongs 2013-02-26 22:34:50 UTC
(In reply to comment #3)

The host machine is running Debian Linux 6.0.6 (aka squeeze) and php 5.4.10
Comment 5 bhu73 2013-08-05 13:49:21 UTC
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).
Comment 6 Sam Reed (reedy) 2013-08-05 13:52:21 UTC
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
Comment 7 Gerrit Notification Bot 2014-06-24 19:41:46 UTC
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
Comment 8 Gerrit Notification Bot 2014-07-04 07:43:48 UTC
Change 141765 merged by jenkins-bot:
Fix mime detection of easily-confused-with text/plain formats

https://gerrit.wikimedia.org/r/141765
Comment 9 Bawolff (Brian Wolff) 2014-07-04 17:03:59 UTC
This should be fixed on mediawiki 1.24

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links