# 上传类型
可以直接设置 input
标签的 accept
属性来限制上传文件的类型
<input type="file" accept="application/msword" />
1
accept 属性列表
- accept="application/msexcel"
- accept="application/msword"
- accept="application/pdf"
- accept="application/poscript"
- accept="application/rtf"
- accept="application/x-zip-compressed"
- accept="audio/basic"
- accept="audio/x-aiff"
- accept="audio/x-mpeg"
- accept="audio/x-pn/realaudio"
- accept="audio/x-waw"
- accept="image/gif"
- accept="image/jpeg"
- accept="image/tiff"
- accept="image/x-ms-bmp"
- accept="image/x-photo-cd"
- accept="image/x-png"
- accept="image/x-portablebitmap"
- accept="image/x-portable-greymap"
- accept="image/x-portable-pixmap"
- accept="image/x-rgb"
- accept="text/html"
- accept="text/plain"
- accept="video/quicktime"
- accept="video/x-mpeg2"
- accept="video/x-msvideo"
如果限制上传的文件为图片格式,则可以直接写成:accept = 'image/\*'
;