input file accept类型
Posted 世界,太精彩
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了input file accept类型相关的知识,希望对你有一定的参考价值。
Valid Accept Types:
For CSV files (.csv), use:
<input type="file" accept=".csv" />
For Excel Files 2003-2007 (.xls), use:
<input type="file" accept="application/vnd.ms-excel" />
For Excel Files 2010 (.xlsx), use:
<input type="file" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
For Text Files (.txt) use:
<input type="file" accept="text/plain" />
For Image Files (.png/.jpg/etc), use:
<input type="file" accept="image/*" />
For html Files (.htm,.html), use:
<input type="file" accept="text/html" />
For Video Files (.avi, .mpg, .mpeg, .mp4), use:
<input type="file" accept="video/*" />
For Audio Files (.mp3, .wav, etc), use:
<input type="file" accept="audio/*" />
For PDF Files, use:
<input type="file" accept=".pdf" />
NOTE:
If you are trying to display Excel CSV files (.csv
), do NOT use:
text/csv
application/csv
text/comma-separated-values
(works in Opera only).
以上是关于input file accept类型的主要内容,如果未能解决你的问题,请参考以下文章