Can't upload csv file using my windows or Android phone
To Reproduce Error
make sure you are using a windows machine with ms-excel installed or an Android phone
go to (https://pastebin.com/F36YRqqf) and copy the csv file, open a text file on your local
machine, add the csv text into the file and save it with a .csv extension
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
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)