Reputation: 17900
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"},
],
Upvotes: 3
Views: 912
Reputation: 543
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).
Upvotes: 5
Reputation: 126
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.
Upvotes: 4