input標籤 限制文件類型

Valid Accept Types:html

For CSV files (.csv), use:app

<input type="file" accept=".csv" />
For Excel Files 2003-2007 (.xls), use: ide

<input type="file" accept="application/vnd.ms-excel" />
For Excel Files 2010 (.xlsx), use: excel

<input type="file" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
For Text Files (.txt) use: orm

<input type="file" accept="text/plain" />
For Image Files (.png/.jpg/etc), use: xml

<input type="file" accept="image/*" />
For HTML Files (.htm,.html), use:htm

<input type="file" accept="text/html" />
For Video Files (.avi, .mpg, .mpeg, .mp4), use:input

<input type="file" accept="video/*" />
For Audio Files (.mp3, .wav, etc), use:io

<input type="file" accept="audio/*" />
For PDF Files, use:form

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

相關文章
相關標籤/搜索