[html] view plain copy
Valid Accept Types:
For CSV files (.csv), use:
For Excel Files 2003-2007 (.xls), use:
For Excel Files 2010 (.xlsx), use:
For Text Files (.txt) use:
For Image Files (.png/.jpg/etc), use:
For HTML Files (.htm,.html), use:
For Video Files (.avi, .mpg, .mpeg, .mp4), use:
For Audio Files (.mp3, .wav, etc), use:
For PDF Files, use:
DEMO:
http://jsfiddle.net/dirtyd77/LzLcZ/144/
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).
If you are trying to display a particular file type (for example, a WAV or PDF), then this will almost always work…
原文:http://stackoverflow.com/questions/11832930/html-input-file-accept-attribute-file-type-csv