<input type='file'> accept属性
来源:互联网 发布:linux 单网卡 nat 编辑:程序博客网 时间:2024/06/04 17:50
input标签是在前台开发中经常使用的,总结下其accept属性,即允许上传的文件类型。
input标签内置了很多允许上传的文件类型,只需要对应配置即可。
<input type="file" accept="application/msword" >
accept列表
1.accept="application/msexcel"
2.accept="application/msword"
3.accept="application/pdf"
4.accept="application/poscript"
5.accept="application/rtf"
6.accept="application/x-zip-compressed"
7.accept="audio/basic"
8.accept="audio/x-aiff"
9.accept="audio/x-mpeg"
10.accept="audio/x-pn/realaudio"
11.accept="audio/x-waw"
12.accept="image/gif"
13.accept="image/jpeg"
14.accept="image/tiff"
15.accept="image/x-ms-bmp"
16.accept="image/x-photo-cd"
17.accept="image/x-png"
18.accept="image/x-portablebitmap"
19.accept="image/x-portable-greymap"
20.accept="image/x-portable-pixmap"
21.accept="image/x-rgb"
22.accept="text/html"
23.accept="text/plain"
24.accept="video/quicktime"
25.accept="video/x-mpeg2"
26.accept="video/x-msvideo"
=======================================================
由于不同浏览器的兼容问题,可能对应不同浏览器无法使用,经测试,在chrome下测试通过。后续其他的浏览器也会去适配(IE待定)
若上传的文件中的选择有多个,可以在accept中进行添加。
例:
同样,也可以使用通配符进行匹配
例:
当然,这里面的文件无法包括全部,若需要对其他文件进行控制,则建议自行进行校验控制。
0 0
- <input type="file" />accept属性列表
- <input type="file" />accept属性列表
- <input type='file'> accept属性
- <input type='file'> accept属性
- <input type="file">的accept属性值详解
- input type=file accept属性上传文件很慢
- <input type="file"/>中的accept常用属性
- Html+CSS input type=file 文件类型限制属性 accept (HTML 5)
- input type=file accept中可以限制的文件类型
- input type=file accept中可以限制的文件类型
- input type=file accept中可以限制的文件类型
- input type=file accept中可以限制的文件类型
- input type=file accept中可以限制的文件类型
- <input type="file">accept属性 调起手机摄像头 支持Safari Chrome和大部分手机内置浏览器
- input type="file"
- input type=file
- 58 css 改变input type=file样式 placeholder属性
- input[file]标签的accept=”image/*”属性响应很慢的解决办法
- UIDatePiker将日期设置成中文
- ApplicationLoader登录失败. Please sign in with an app-specific password.
- Lua coroutine.create
- 杜甲同学DJZipAchive解压缩zip文件
- git学习记录-简单常用版(大神慎入)
- <input type='file'> accept属性
- 如何对OkHttp进行封装?
- swift如何压缩图片到指定大小以内,尺寸和体积双压缩
- Android的权限大全和动态使用Android权限方法
- java中的静态和非静态调用关系
- 【Android图像处理】荧光绿滤镜(效果)
- Linux FTP 命令全集
- 黑客必备
- pyqt5学习(一)基础操作