The capture and accept attributes of the HTML file input control do not work properly

PHPz
Release: 2023-09-06 14:25:03
forward
1406 people have browsed it

The capture and accept attributes of the HTML file input control do not work properly

Use the accept attribute to set the file types accepted by the server in HTML. This attribute can only be used in tags.

Example

You can try running the following code to use 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>
Copy after login

The capture attribute is a boolean property that, if specified, indicates that capturing media directly from the device is preferred. ..

The capture attribute is not used to include camera options in the dialog box, but indicates that capturing directly from the webcam is preferred.

The "correct" code is given below

<input type = "file" accept = "image/*">
Copy after login

The above is the detailed content of The capture and accept attributes of the HTML file input control do not work properly. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template