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