The above example demonstrates usage of the <input> element with the accept attribute.

The accept attribute allows you to specify the file types that will be accepted when using a file upload control. When using type="file" to allow the user to upload a file to the server, the accept attribute allows you to restrict the file types that they can upload. Any file type that is not specified will not be accepted.

When using this attribute, provide a comma-separated list of content types that the server accepts.

It's best to specify both the MIME type as well as any extensions that might be used.