Accept attribute in html
Specify that the server accepts only image files in the file upload
< form action= "demo_form.asp" >
< input type= "file" name= "pic" accept= "image/*" >
< input type= "submit" >
< /form >
Definition and Usage
The accept attribute specifies the types of files that the server accepts (that can be submitted through a file upload).
Note:
The accept attribute can only be used with <input type="file">.
and also use in <asp:fileupload>
Syntax
<input accept="file_extension
|audio/*|video/*|image/*|media_type
">
Attribute Values
| Value | Description |
|---|---|
| file_extension | A file extension starting with the STOP character, e.g: .gif, .jpg, .png, .doc |
| audio/* | All sound files are accepted |
| video/* | All video files are accepted |
| image/* | All image files are accepted |
| media_type | A valid media type, with no parameters. Look at IANA Media Types for a complete list of standard media types |
Comments
Post a Comment