码迷,mamicode.com
首页 > Web开发 > 详细

Html杂记

时间:2017-07-26 15:37:47      阅读:192      评论:0      收藏:0      [点我收藏+]

标签:word   属性   input   通过   blog   span   app   html   put   

1.通过accept过滤文件类型

<input type="file" id="myFile" accept="image/jpeg,image/gif,application/msword"/><br/>
在文件上传控件的accept属性中,接受以下两种格式的限制符:
  文件类型,但不限制具体扩展名,如:image/*,就只要是图片就行。
  文件类型+具体的文件扩展类型,如:image/jpeg,使用的是MIME_TYPE类型
多个MIME_TYPE类型之间用逗号分隔。

以下是几个常用的类型,其它的可以查询相关资料:
.doc                application/msword
.jpg                image/jpg
.txt                text/plain
.xls                application/vnd.ms-excel

 

Html杂记

标签:word   属性   input   通过   blog   span   app   html   put   

原文地址:http://www.cnblogs.com/ghai/p/7239726.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!