
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
HTML file input control with capture and accept attributes is not working correctly
Use the accept attribute to set the types of files that the server accepts in HTML. Use the attribute only with <input type="file">.
Example
You can try to run the following code to work with the accept attribute:
<!DOCTYPE html> <html> <head> <title>File Upload Box</title> </head> <body> <form> <input type = "file" name = "fileupload" accept = "image/*" /> </form> </body> </html>
The capture attribute is a boolean attribute that, if specified, indicates that the capture of media directly from the device...is preferred.
The capture attribute is NOT used to include the camera option in the dialog but to indicate that direct capture from the webcam is preferred.
The "correct" code is given below
<input type = "file" accept = "image/*">
- Related Articles
- HTML DOM Input FileUpload accept Property
- JavaScript input type=submit is not working?
- The onchange event is not working in color type input with JavaScript
- How to capture file not found exception in Java?
- How to capture file not found exception in C#?
- HTML accept Attribute
- How to add and remove HTML attributes with jQuery?
- Working with NULL and IS NOT NULL in MySQL
- HTML Attributes
- HTML accept-charset Attribute
- Modification not working for both internal table and control table in SAP ABAP
- HTML data-* Attributes
- How to check input file is empty or not using JavaScript/jQuery?
- Set file attributes in Java
- Attributes of HTML element

Advertisements