<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>文件框筛选文件</title>
</head>
<body>
显示全部文件:<input type="file"/><br/>
允许上传视频文件:<input type="file" accept="video/*"/><br/>
允许上传音频文件:<input type="file" accept="audio/*"/><br/>
允许上传图片文件:<input type="file" accept="image/*"/><br/>
允许上传多种文件格式:<input type="file" accept="audio/*,video/*,image/jpeg"/>
允许上传多种文件格式:<input type="file" accept="image/jpeg,image/png"/>
</body>
</html>
如果需要多个条件进行筛选,可根据逗号进行分割
*表示所有的类型
需要查看到更多的MIME_type类型,可参考这个网站
https://www.iana.org/assignments/media-types/media-types.xhtml