Language References
Specifies the types of files a user can upload.
Inline |
<element accept = strFileType1 [ , strFileType2 ]...> |
Script |
object.accept = strFileType [ , strFileType2 ] ... |
strFileType |
Character string that denotes unique file type specifiers. |
The property is read/write with no default value.
The accept attribute takes as its value a comma-separated list of one or more file types, or unique file type specifiers, describing which file types to allow.
<label for="movie">Choose a movie to upload:</label>
<input type="file" id="movie" name="movie" accept="video/*" />
<label for="poster">Choose a poster:</label>
<input type="file" id="poster" name="poster" accept="image/png, image/jpeg" />
which would render as follows:
INPUT TYPE=FILE