html5 input选择文件,input文件选择,限定文件类型。
input文件选择,限定文件类型
当使用input提交文件时,用accept方法,可以限制上传文件的类型。
如:
<input type="file" name="upload" multiple="multiple" accept=".zip">
accept可以指定的常见类型:
(使用时,用如上的.zip就可以了)
*.3gpp audio/3gpp, video/3gpp 3GPP Audio/Video
*.ac3 audio/ac3 AC3 Audio
*.asf allpication/vnd.ms-asf Advanced Streaming Format
*.au audio/basic AU Audio
*.css text/css Cascading Style Sheets
*.csv text/csv Comma Separated Values
*.doc application/msword MS Word Document
*.dot application/msword MS Word Template
*.dtd application/xml-dtd Document Type Definition
*.dwg image/vnd.dwg AutoCAD Drawing Database
*.dxf image/vnd.dxf AutoCAD Drawing Interchange Format
*.gif image/gif Graphic Interchange Format
*.htm text/html HyperText Markup Language
*.html text/html HyperText Markup Language
*.jp2 image/jp2 JPEG-2000
*.jpe image/jpeg JPEG
*.jpeg image/jpeg JPEG
*.jpg image/jpeg JPEG
*.js text/javascript, application/javascript JavaScript
*.json application/json JavaScript Object Notation
*.mp2 audio/mpeg, video/mpeg MPEG Audio/Video Stream, Layer II
*.mp3 audio/mpeg MPEG Audio Stream, Layer III
*.mp4 audio/mp4, video/mp4 MPEG-4 Audio/Video
*.mpeg video/mpeg MPEG Video Stream, Layer II
*.mpg video/mpeg MPEG Video Stream, Layer II
*.mpp application/vnd.ms-project MS Project Project
*.ogg application/ogg, audio/ogg Ogg Vorbis
*.pdf application/pdf Portable Document Format
*.png image/png Portable Network Graphics
*.pot application/vnd.ms-powerpoint MS PowerPoint Template
*.pps application/vnd.ms-powerpoint MS PowerPoint Slideshow
*.ppt application/vnd.ms-powerpoint MS PowerPoint Presentation
*.rtf application/rtf, text/rtf Rich Text Format
*.svf image/vnd.svf Simple Vector Format
*.tif image/tiff Tagged Image Format File
*.tiff image/tiff Tagged Image Format File
*.txt text/plain Plain Text
*.wdb application/vnd.ms-works MS Works Database
*.wps application/vnd.ms-works Works Text Document
*.xhtml application/xhtml+xml Extensible HyperText Markup Language
*.xlc application/vnd.ms-excel MS Excel Chart
*.xlm application/vnd.ms-excel MS Excel Macro
*.xls application/vnd.ms-excel MS Excel Spreadsheet
*.xlt application/vnd.ms-excel MS Excel Template
*.xlw application/vnd.ms-excel MS Excel Workspace
*.xml text/xml, application/xml Extensible Markup Language
*.zip aplication/zip Compressed Archive
input文件选择,限定文件类型。你学会了吗?:)
html5 input选择文件,input文件选择,限定文件类型。相关推荐
- [html] input上传文件可以同时选择多张吗?怎么设置?
[html] input上传文件可以同时选择多张吗?怎么设置? <input type="file" multiple /> 个人简介 我是歌谣,欢迎和大家一起交流前后 ...
- [html] input上传文件可以同时选择多张吗?怎么设置?
[html] input上传文件可以同时选择多张吗?怎么设置? <input type="file" multiple="multiple" value= ...
- input[type=file]去掉“未选择任何文件”及样式改进
原文地址:input[type=file]去掉"未选择任何文件"及样式改进 - 腾讯云开发者社区-腾讯云 input 标签的 file 属性,在没有选择文件的情况下,默认显示一条文 ...
- 创建输入控件(input控件、文本框、密码框、单项选择、多项选择、重置与提交按钮的设置)
创建输入控件 input控件的相关概念 input控件的属性 input控件的类型 文本框的设置 密码框的设置 单项选择的设置 多项选择的设置 重置与提交按钮的设置 综合运用 相关概念选择题及参考答案 ...
- 在html中的file怎么只能选择图片,input type=file 选择图片并且实现预览效果
通过标签,给它指定type类型为file,可提供文件上传: accept:可选择上传类型,如:只要传图片,且不限制图片格式,为image/*: multiple:规定是否可以选择多个文件: 规定只可上 ...
- php文件上传css,CSS_文件上传input file简便美化方案(css),文件上传input在各个浏览器里 - phpStudy...
文件上传input file简便美化方案(css) 文件上传input在各个浏览器里表现形式都不一样: ie6 ie7,8,9 ff chrome 这里介绍一种简单实用的,在各种浏览器下表现一致的美化 ...
- 原生input标签实现ajax单文件上传和多文件上传
自己还是一个菜鸟的时候,有次项目经理让我用Java做一个多文件上传的功能.那时候技术学得很渣,最多只能够实现单文件上传.做了一个星期都没有做出来,于是项目经理不留半点情面,当着办公室所有人的面痛批我一 ...
- 移动端h5实现手机拍照上传图片,相册选择上传图片input type=file
移动端h5实现手机拍照上传图片,相册选择上传图片input type=file 有不足或者不对的在下方留言,有不明白的也请在下方留言,虽然我不一定能看到,话不多说上代码,注释都写好了 <!doc ...
- js/jquery 获取本地文件的文件路劲 获取input框中type=‘file’ 中的文件路径(转载)...
原文:http://blog.csdn.net/niyingxunzong/article/details/16989947 js/jquery 获取本地文件的文件路劲 获取input框中type=' ...
最新文章
- application/x-www-form-urlencoded multipart/form-data text/plain 的区别和作用
- 某些列满足某些条件就被改是什么值,不满足就被改为另外的一些值(python pandas)
- tomcat配置多个web网站的配置详解
- POJ - 3254 Corn Fields(状压dp)
- linux7.0ftp,Linux(Centos7)搭建FTP服务
- Java微信公众号开发(五)—— SVN版本控制工具
- cnblogs客户端发贴解析,Post,Get分析
- C++之指针探究(七):void指针、空指针、野指针、各种零所代表的含义
- ha 配置ssl_haproxy ssl 配置方式-阿里云开发者社区
- PHP:header()函数
- Struts2通配符详解
- 计算机如何更改键盘设置在哪里设置,原神pc按键怎么改
- 什么是DNS Spoofing, DNS Hijacking, and DNS Cache Poisoning?
- 反思-我们真的初老了么?
- K成本中心PO总账科目矛盾报错
- AltiumDesigner PCB 文件过大
- 计算机重启后一直黑屏转圈,技术员教你解决win10开机无限黑屏转圈重启的解决方法...
- ipv6的127位掩码如何表示_计算机子网掩码知识举例详解
- 安装mavros时,运行 wstool update -t src -j8 时出错解决
- 约束constrain,SystmVerilog语法
热门文章
- 由a标签的onclick影出来的问题
- Rational Rose :从用例图开始
- 水墨流动生太极,四式''拳诀''展存储
- 关于C/C++程序的一些规范(2005-5-10)
- 火狐marquee_火狐不支持marquee解决方案
- python os模块打开文件_Python 文件操作之OS模块
- mybatisplus service insert 空指针_c++ 图解层序遍历和逐层打印智能指针建造的二叉树...
- 昆仑通态如何连接sqlserver数据库_三菱FX5U 与昆仑通态触摸屏的连接操作步骤
- 监听返回app_基于 Redis 消息队列实现 Laravel 事件监听及底层源码探究
- python强制退出循环_for循环、while循环、break跳出循环、continue结束本次循环、exit退出本次脚本...