Valid Accept Types:

For CSV files (.csv), use:

<input type="file" accept=".csv" />

For Excel Files 2003-2007 (.xls), use:

<input type="file" accept="application/vnd.ms-excel" />

For Excel Files 2010 (.xlsx), use:

<input type="file" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />

For Text Files (.txt) use:

<input type="file" accept="text/plain" />

For Image Files (.png/.jpg/etc), use:

<input type="file" accept="image/*" />

For HTML Files (.htm,.html), use:

<input type="file" accept="text/html" />

For Video Files (.avi, .mpg, .mpeg, .mp4), use:

<input type="file" accept="video/*" />

For Audio Files (.mp3, .wav, etc), use:

<input type="file" accept="audio/*" />

For PDF Files, use:

<input type="file" accept=".pdf" />

NOTE:

If you are trying to display Excel CSV files (.csv), do NOT use:

  • text/csv
  • application/csv
  • text/comma-separated-values (works in Opera only).

input file accept类型的更多相关文章

  1. 【转】input file accept属性可以限制的文件类型

    来源:http://blog.sina.com.cn/s/blog_6c9d65a10101a8yh.html 在上传文件的时候,需要限制指定的文件类型. <input type="f ...

  2. html input file accept 上传文件类型限制格式 MIME 类型列表

    例: <input type="file" accept="application/vnd.openxmlformats-officedocument.spread ...

  3. html input file accept

    *.3gpp audio/3gpp, video/3gpp 3GPP Audio/Video*.ac3 audio/ac3 AC3 Audio*.asf allpication/vnd.ms-asf ...

  4. input file实现多选和限制文件上传类型

    <!-- input file  accept 属性设置可上传文件的类型  multiple属性设置可多文件上传--> <!-- accept 并未真正的实现限制上传文件类型,只是在 ...

  5. input type=file accept中可以限制的文件类型

    在上传文件的时候,需要限制指定的文件类型. <input type="file" accept="image/*" /> accept表示可以上传文 ...

  6. HTML5 input file控件使用accept过滤限制的文件类型以及在谷歌下打开很慢的问题

    在文件上传控件(input type='file')中,可以通过accept属性实现对文件类型的过滤. 一.相关代码: 下面给出对应的文件上传控件代码: <input type="fi ...

  7. <input type="file"> accept属性筛选文件类型

    如果你不希望用户上传任何类型的文件, 你可以使用 input 的 accept 属性. 设置支持 .doc / .docx / .xls / .xlsx / .pdf 格式: <input ty ...

  8. HTML5的 input:file上传类型控制

    一.input:file属性 属性值有以下几个比较常用: accept:表示可以选择的文件MIME类型,多个MIME类型用英文逗号分开,常用的MIME类型见下表. multiple:是否可以选择多个文 ...

  9. input file控件限制上传文件类型

    网页上添加一个input file HTML控件: <input id="File1" type="file" /> 默认是这样的,所有文件类型都会 ...

随机推荐

  1. 004-mac上安装以及Nginx 配置文件nginx.conf详解

    1.mac上nginx安装 安装brew:go-001-环境部署,IDEA插件 安装nginx: brew search nginx brew install nginx 当然也可以编译安装 安装完以 ...

  2. vue-filter

  3. EOS 帐户权限操作--你找不到的干货 (原创) 续集-EOS 3.0

    https://eosfans.io/topics/372 关于2.0权限问题请移步https://eosfans.io/topics/28 目录 查看权限 改变权限 增加权限 删除权限 查看权限 有 ...

  4. awk命令分析日志的简单笔记

    awk是一个文本分析工具,可以用来进行流量日志分析 之前无意中看到了这个命令,简单记一下笔记 ,在打线下的时候可能会有用 awk有3个不同版本: awk.nawk和gawk,未作特别说明,一般指gaw ...

  5. iot-dm异常日志

    iot-dm 本机断网日志 2018-03-15 08:55:41,345 INFO com.inspur.iot.client.core.IotConnection Connection is be ...

  6. SSM基础整合

    1.表现层: 依赖jar包:spring+JSP+文件上传组件+dubbo+fastdfs web.xml配置:乱码过滤器+DispatcherServlet前端控制器 <!-- 配置post乱 ...

  7. 基于Extjs+SpringMVC+MyBatis+Oracle的B/S信息系统简化开发思路

    要在上层简化就得有下层强大的架构作为支撑,通过采用企业级的各种框架,虽然学习成本高一些,但用好了效率也自然高. 数据层简化: 首先所有表都有名称为ID的主键字段.有与表同名的序列作为自增key. 数据 ...

  8. [LeetCode] 504. Base 7_Easy tag: Math

    Given an integer, return its base 7 string representation. Example 1: Input: 100 Output: "202&q ...

  9. Please add or free up more resources then turn off safe mode manually.

    解决方案:硬盘满了,释放硬盘空间.

  10. IntelliJ IDEA 17 本地LicenseServer激活

    注意:此方法适用于Idea v2017.2.x 版本及以前版本. IntelliJ IDEA及破解包下载地址:百度网盘   密码:hlko 一.将IntelliJIDEALicenseServer.e ...