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">.


You can try to run the following code to work with the accept attribute:

<!DOCTYPE html>
   <title>File Upload Box</title>    
         <input type = "file" name = "fileupload" accept = "image/*" />  

The capture attribute is a boolean attribute that, if specified, indicates that the capture of media directly from the 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/*">
Lakshmi Srinivas
Lakshmi Srinivas

Programmer / Analyst / Technician