input file 上传文件类型控制
文件类型 accept
*.3gpp audio/3gpp, video/3gpp
.ac3 audio/ac3
.asf allpication/vnd.ms-asf
.au audio/basic
.css text/css
.csv text/csv
.doc application/msword
.dot application/msword
.dtd application/xml-dtd
.dwg image/vnd.dwg
.dxf image/vnd.dxf
.gif image/gif
.htm text/html
.html text/html
.jp2 image/jp2
.jpe image/jpeg
.jpeg image/jpeg
.jpg image/jpeg
.js text/javascript, application/javascript
.json application/json
.mp2 audio/mpeg, video/mpeg
.mp3 audio/mpeg
.mp4 audio/mp4, video/mp4
.mpeg video/mpeg
.mpg video/mpeg
.mpp application/vnd.ms-project
.ogg application/ogg, audio/ogg
.pdf application/pdf
.png image/png
.pot application/vnd.ms-powerpoint
.pps application/vnd.ms-powerpoint
.ppt application/vnd.ms-powerpoint
.rtf application/rtf, text/rtf
.svf image/vnd.svf
.tif image/tiff
.tiff image/tiff
.txt text/plain
.wdb application/vnd.ms-works
.wps application/vnd.ms-works
.xhtml application/xhtml+xml
.xlc application/vnd.ms-excel
.xlm application/vnd.ms-excel
.xls application/vnd.ms-excel
.xlt application/vnd.ms-excel
.xlw application/vnd.ms-excel
.xml text/xml, application/xml
.zip application/zip
.xlsx application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
.xltx application/vnd.openxmlformats-officedocument.spreadsheetml.template
.potx application/vnd.openxmlformats-officedocument.presentationml.template
.ppsx application/vnd.openxmlformats-officedocument.presentationml.slideshow
.pptx application/vnd.openxmlformats-officedocument.presentationml.presentation
.sldx application/vnd.openxmlformats-officedocument.presentationml.slide
.docx application/vnd.openxmlformats-officedocument.wordprocessingml.document
.dotx application/vnd.openxmlformats-officedocument.wordprocessingml.template
.xlsm application/vnd.ms-excel.addin.macroEnabled.12
.xlsb application/vnd.ms-excel.sheet.binary.macroEnabled.12
追加!!!!!!!
在上传图片时, accept不要设置成 accept="image/png,image/jpg,image/jpeg"!
后果: 浏览图片时不会自动进入相册,默认打开的是最近使用文档文件夹 但是最近的显示为空,而且图片会变灰选择不了,因为这个,我TM被老板骂惨了!5555555
直接设置成 accept="image/*" ;
望周知.
input file 上传文件类型控制的更多相关文章
- 在HTML5的 input:file 上传文件类型控制 遇到的问题
1.input:file 属性的介绍 先瞅代码吧 <form> <input type="file" name="pic" accept=& ...
- HTML5的 input:file上传 以及 类型控制
以HTML5的文件上传API 如下demo代码在.html文件打开即可: !DOCTYPE html> <html lang="zh_cn"> <head& ...
- input:file上传文件类型(记录)
imput 属性有以下几种: 1.type:input类型这就不多说了2.accept:表示可以选择的文件类型,多个类型用英文逗号分开,常用的类型见下表. <input id="fil ...
- input 限制 上传文件类型
参考:input file控件限制上传文件类型 HTML <input> 标签的 accept 属性 网页上添加一个input file HTML控件: <input id=&quo ...
- ajax+ashx 完美实现input file上传文件
1.input file 样式不能满足需求 <input type="file" value="浏览" /> IE8效果图: Firefox效 ...
- input file 上传文件
面试的时候遇到一个问题,要求手写的方式上传文件. 本来觉得很简单,但是结果怎么也成功不了. 前台: <form ID="form1" action="AcceptF ...
- input file上传文件
如何使用input[type='file']来上传文件呢? html: //angular<input type="file" (change)="fileChan ...
- 巧妙利用label标签实现input file上传文件自定义样式
提到上传文件,一般会想到用input file属性来实现,简单便捷,一行代码即可 但input file原生提供的默认样式大多情况下都不符合需求,且在不同浏览器上呈现的样式也不尽相同 我们往 ...
- 使用input file上传文件中onChange事件只触发一次问题
每次上传文件的时候,都会将当前的文件路径保存至$event.target.value中,当第二次选择文件时,由于两次$event.target.value相同,所以不会触发change事件. 解决方案 ...
随机推荐
- IBM研究人员开发了一对低功耗,高性能的计算机视觉系统
机器学习算法近年来有了突飞猛进的发展.例如,像Facebook这样的最先进的系统,可以在一小时内训练图像分类算法,而不会牺牲准确性.但是,许多这些系统都是在具有强大GPU的高端机器上进行培训的,随着物 ...
- pandas模块之读取文件
首先我们来看一个文件 1 男 北京 刘一 我笑 #跳过此行,序号1 2 女 上海 刘珊 你笑 3 男 杭州 刘五 他笑 #跳过此行,序号四 4 女 重庆 刘六 不笑了 下面来分析内容,并使用参数 1 ...
- Android 获取手机(ios,android)的设备唯一码(mac地址, IMEI)
{ /*获取手机(ios,android)的设备唯一码(mac地址, IMEI)2018年02月16日 ⁄ 综合 ⁄ 共 2697字 ⁄ 字号 小 中 大 ⁄ 评论关闭 app中总会用到客户端下载量数 ...
- JS中关于数组的操作
1.如何创建数组: var arr = []; //效率更高 var arr1 = new Array(); var arr2 = new Array(5); //数组的长度为5,当参数为一个时,将会 ...
- 【CF741D】Arpa’s letter-marked tree and Mehrdad’s Dokhtar-kosh paths(dsu on tree)
题意:我们称一个字符串为周驿东串当且仅当重排它的字符可以组成一个回文串. 给出一个n个点的有根树,根为1,每条边上有一个从a到v的字符,求每个点的子树中所有简单路径可以组成的周驿东串中的最长长度. n ...
- (67) c# 序列化
二进制序列化器 xml序列化器 数据契约序列化器
- python 3.x上安裝web.py
python 3.x上安裝web.py 查询之后,安装时使用pip3 install web.py==0.40.dev0 最終可以运行 app.py import weburls=( '/',' ...
- 开源 NAS 操作系统不完全汇总
市面上能见到的 NAS 操作系统很多,有如 FreeNAS 这样意气风发的开源免费版,也有完全商业的闭源版本,更有如黑群晖之类的破解版本.NAS 系统的迭代是一个大浪淘沙的过程,活下来的系统在功能上逐 ...
- Weblgic安装应用报错:Caused by: com.bea.xml.XmlException: failed to load java type corresponding to e=web-a
文章目录 报错如下 解决: 报错如下 Exception in AppMerge flows' progression 后台日志报错: Caused by: com.bea.xml.XmlExcept ...
- mvc 当中 [ValidateAntiForgeryToken] 的作用 转载https://www.cnblogs.com/hechunming/p/4647646.html
一.CSRF是什么? CSRF(Cross-site request forgery),中文名称:跨站请求伪造,也被称为:one click attack/session riding,缩写为:CSR ...