Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
December 26, 2022 01:52 pm GMT

HTML input[type=file] accept types

For CSV files (.csv), use:
<input type="file" accept=".csv" />

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

For Excel Files 2007+ (.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" />


Original Link: https://dev.to/acrobat/html-inputtypefile-accept-types-1g2o

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To