Skip to content

Instantly share code, notes, and snippets.

@rajankur
Created September 26, 2016 17:18
Show Gist options
  • Save rajankur/3134a42c24cb356a3a091700f27b05b4 to your computer and use it in GitHub Desktop.
Save rajankur/3134a42c24cb356a3a091700f27b05b4 to your computer and use it in GitHub Desktop.
Valid Accept types for HTML input tag
<!-- Specifying multiple formats -->
<input type="file" accept=".csv, .txt" />
<!-- For CSV -->
<input type="file" accept=".csv" />
<!-- For Excel 97-2003 -->
<input type="file" accept="application/vnd.ms-excel" />
<!-- For Excel 2007+ -->
<input type="file" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
<!-- For .txt -->
<input type="file" accept="text/plain" />
<!-- For images -->
<input type="file" accept="image/*" />
<!-- For HTML files -->
<input type="file" accept="text/html" />
<!-- For Video files -->
<input type="file" accept="video/*" />
<!-- For Audio files -->
<input type="file" accept="audio/*" />
<!-- For .pdf -->
<input type="file" accept=".pdf" />
@nguyenduclong-ict
Copy link

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment