Home  >  Article  >  Web Front-end  >  Sets the file types the server accepts in HTML

Sets the file types the server accepts in HTML

WBOY
WBOYforward
2023-08-28 19:41:021101browse

Sets the file types the server accepts in HTML

Use the accept attribute to set the file types accepted by the server in HTML. Use this attribute only 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>

The above is the detailed content of Sets the file types the server accepts in HTML. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete