type=file 自定义文件默认可选类型

1 <input type="file" accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" />    

这个是样式使用的方法,多个样式用逗号隔开

文件类型对应的值:

 1 <!--cvs-->
 2 accept=".csv"
 3 <!--Excel Files 2003-2007 (.xls)-->
 4 accept="application/vnd.ms-excel"
 5 <!--Excel Files 2010 (.xlsx)-->
 6 accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
 7 <!--Text Files (.txt)-->
 8 accept="text/plain"
 9 <!--Image Files (.png/.jpg/etc),-->
10 accept="image/*"
11 <!--HTML Files (.htm,.html),-->
12 accept="text/html"
13 <!--Video Files (.avi, .mpg, .mpeg, .mp4)-->
14 accept="video/*"
15 <!--Audio Files (.mp3, .wav, etc),-->
16 accept="audio/*"
17 <!-- PDF-->
18 accept=".pdf"

原文地址:http://blog.csdn.net/hanshileiai/article/details/44702923

posted @ 2018-01-24 11:04  天涯已可  阅读(2320)  评论(0编辑  收藏  举报