wikimedia / WikiContrib

A tool for Wikimedia community members to visualize their technical contributions
https://wikicontrib.toolforge.org
MIT License
23 stars 32 forks source link

CSV upload not working on windows with ms excel installed and on Android phone #125

Closed NdibeRaymond closed 4 years ago

NdibeRaymond commented 4 years ago

Can't upload csv file using my windows or Android phone

To Reproduce Error

Expected result The file should upload with no problem

Actual result An error is thrown saying "Only csv files can be uploaded!"

Update After doing my research, I found out that on a Windows machine with ms-excel installed, CSV files may have a MIME type of "application/vnd.ms-excel" rather than the normal type of "text/csv". Android phones seems to have a similar issue though I haven't figured out what MIME Type is used in the case of Android. on way to go about fixing this is to manually change the windows registry value for CSV files to "text/csv" for every windows machine trying to access wikicontrib, but that would be impractical. I think the best way to go about it, for now, is to expand the validation coverage to include cases like this by detecting other MIME types that a CSV file can have

Further read (https://christianwood.net/csv-file-upload-validation/) (https://github.com/mholt/PapaParse/issues/18)

NdibeRaymond commented 4 years ago

@srish i would love to take on this bug

srish commented 4 years ago

@NdibeRaymond Thank you :) This is superb!