限制input type=“file“ 文件上传类型

cvs格式

<input text="file" accept=".csv" />

.xls格式

<input text="file"  accept="application/vnd.ms-excel"/>

 .xslx格式

<input text="fiel" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"/>

.txt格式

<input type="file" accept="text/plain" />

所有图片格式

<input type="file" accept="image/*" />

.htm,.html格式

<inputtype="file" accept="text/html" />

video(.avi, .mpg, .mpeg, .mp4)格式

<input type="file" accept="video/*" />

audio(.mp3, .wav, etc)格式

<input type="file" accept="audio/*" />

.pdf格式

<input type="file" accept=".pdf" />

.zip格式

<input type="file" accept=".zip" />

上传多个(multiple)

<input type="file" accept=".zip" multiple />

上传文件夹(webkitdirectory) (注意 : 上传文件夹 只能上传文件夹,不可以和文件同时上传)

<input type="file" webkitdirectory />