Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Types Accepted by "file" HTML Input Element's Preexisting MIME Types

Tags:

html

input

web

I am curious if there's a list of valid image types (essentially extensions) accepted by using image/* for an input's accept attribute. Example:

<input type="file" accept="image/*">

What extensions would be valid for this? Likewise, for the other two, audio/* and video/*. Thank you!

like image 619
Gabriel Nahmias Avatar asked Apr 16 '13 07:04

Gabriel Nahmias


1 Answers

Here is the way you can allow different filetypes for accept attribute.

<input type="file" accept="image/jpeg,image/gif,image/png" />

Same way you can allow audio and video files as well.

Follow this link: http://en.wikipedia.org/wiki/MIME_type

You can check which filetypes are allowed.

like image 153
Harpreet Avatar answered Nov 15 '22 08:11

Harpreet