asp.net.ph

Skip Navigation Links

ACCEPT Attribute | accept Property

Language References


Specifies the types of files a user can upload.

Applies To: INPUT TYPE=FILE

Syntax


Inline <element accept = strFileType1 [ , strFileType2 ]...>
Script object.accept = strFileType [ , strFileType2 ] ...

Possible Values


strFileType Character string that denotes unique file type specifiers.

The property is read/write with no default value.

Remarks

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.

Example

<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:


Applies To

INPUT TYPE=FILE



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note