accept

Jump to: navigation, search

accept

This article is Not Ready.


W3C Candidate Recommendation

Summary

This attribute supplies browsers with a hint about what filetypes its element will accept.


Applies to HTMLInputElement

Accepts a comma separated list of file types. Valid file types can be any of the following.

  • The string audio/* indicates any audio file is allowed.
  • The string video/* indicates any video file is allowed.
  • The string image/* indicates any image file is allowed.
  • A valid [type] with no attributes.
  • A file extension starting with a . (period).

Duplicates are not allowed (case insensitive).

Compatibility

There is no data available for topic "html", feature "accept". If you think that there should be data available, consider opening an issue.

Examples

Indicates that audio files are accepted.

HTML

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

Indicates that both PNG and GIF file formats are accepted.

HTML

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

Notes

Remarks

The information from the list can be used to filter out nonconforming files when prompting a user to select files to be sent to the server using the <INPUT> element with type="file". Examples of content types include "text/html", "image/png", "image/gif", "video/mpeg", "audio/basic", "text/tcl", "text/javascript", and "text/vbscript". For the current list of registered MIME types, see MIME Media Types. There is no functionality implemented for this property unless defined by the author. accept was introduced in Microsoft Internet Explorer 6


Related specifications

Specification Status Related Changes
HTML5 W3C Candidate Recommendation

See also

Related articles

HTML







  • accept












































… further results


External resources

Related pages (MSDN)

  • input

Attribution

This article contains content originally from external sources.

Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]