admin管理员组文章数量:1389884
I am using the html5 input tag to multiselect only .csv files. I have so far
<input type="file" id="files" name="files[]" accept=".csv" multiple />
but when I click browse, it shows all file types. How can I get this to work?
Thanks.
I am using the html5 input tag to multiselect only .csv files. I have so far
<input type="file" id="files" name="files[]" accept=".csv" multiple />
but when I click browse, it shows all file types. How can I get this to work?
Thanks.
Share asked Mar 16, 2014 at 5:22 omegaomega 44k90 gold badges286 silver badges523 bronze badges2 Answers
Reset to default 5Try:
<input id="fileSelect" type="file" accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" />
Or take a look at this solution.
As per the docs, accept
is used to specify mime types, not file extensions. Try accept="text/csv"
instead.
本文标签: javascriptHow to select only multiple csv files in html5 input tagStack Overflow
版权声明:本文标题:javascript - How to select only multiple .csv files in html5 input tag? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744652193a2617750.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论