Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plupload .csv issue

Tags:

plupload

I am using Plupload to upload .csv files to my site. It works fine except the problem that it doesn't filter .csv files correctly in the file selection model.

This is the code I'm using to filter only .csv files:

filters : [
    {title : "Files of type", extensions : "csv"},
],
like image 227
linkyndy Avatar asked Mar 12 '26 00:03

linkyndy


2 Answers

Look at input[file=type] generated by Plupload, especially in its accept attribute. Plupload adds text/csv value for csv files, which is wrong. The correct value is just .csv

<input type="file" accept=".csv">

Related: HTML Input="file" Accept Attribute File Type (CSV)

Until this issue was not fixed by Plupload team, you can fix it yourself by removing

,text/csv,csv

from plupload.full.min.js (or whatever you use).

like image 77
evpozdniakov Avatar answered Mar 17 '26 03:03

evpozdniakov


Sadly enough I couldn't find the source of this, but I once ran into this issue myself.

The problem was that it will only show the (for example) .csv filter if that extension is registered on the computer you're trying to upload a file.

So if you were testing this on a computer that does not have the .csv extension registered by a program this is most likely the issue.

As I remember I had this issue on Chrome. Not sure what browser you were testing with?

So if this issue is indeed the cause of your problem then this is nothing that Plupload can do for you.

like image 21
Tim Avatar answered Mar 17 '26 03:03

Tim



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!