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

这个是样式使用的方法,多个样式用逗号隔开

文件类型对应的值:

 <!--cvs-->
accept=".csv"
<!--Excel Files 2003-2007 (.xls)-->
accept="application/vnd.ms-excel"
<!--Excel Files 2010 (.xlsx)-->
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
<!--Text Files (.txt)-->
accept="text/plain"
<!--Image Files (.png/.jpg/etc),-->
accept="image/*"
<!--HTML Files (.htm,.html),-->
accept="text/html"
<!--Video Files (.avi, .mpg, .mpeg, .mp4)-->
accept="video/*"
<!--Audio Files (.mp3, .wav, etc),-->
accept="audio/*"
<!-- PDF-->
accept=".pdf"

原文地址:http://blog.csdn.net/hanshileiai/article/details/44702923

type=file 自定义文件默认可选类型的更多相关文章

  1. 获取input type=file 的文件内容(纯文本)

    一.获取input type=file 的文件内容(纯文本) 1.需求一 通过点击其他事件,来触发 文件选择框(限定格式为 .c 文件),而不是手动鼠标点击触发. [思路:] step1:将 inpu ...

  2. input type="file"去掉取消默认原来选择的文件

    很多时候我们上传文件点击取消后或我们制定了内容格式上传不符合,再次点击input="file"按钮时,选择的文件还是原来的文件,却又上传不.当时想在旁边多添加个按钮清除file里面 ...

  3. input type="file"指定文件类型为excel

    指定上传类型为excel:加上accept="application/vnd.ms-excel"即可,只兼容chrome跟ff,不兼容ie <input type=" ...

  4. jquery的input:type=file实现文件上传

    <!DOCTYPE html> <html> <head> <title>html5_2.html</title> <style> ...

  5. html5 file 自定义文件过滤

    使用 acctpe属性即可 示例: gif,jpg <input type="file" name="pic" accept="image/gi ...

  6. 获取 input type=file 上次文件的路径

    可以通过 $('这个元素').val();得到全路径:

  7. 美化 input type=file控件

    大家都知道input的type=file控件默认样式是不能修改的 可以通过一个小技巧处理下 html: <a href="javascript:;" class=" ...

  8. file 自定义上传附件并展示缩略图

    效果图镇楼..   写的有点乱.上传一个实例供大家参考--附件下载地址如何下: https://files.cnblogs.com/files/fchx91/uploadFiles.rar 2019- ...

  9. input[type="file"]的样式以及文件名的显示

    如何美化input[type="file"] 基本思路是: (1)首先在 input 外层套一个 div : (2)将 div 和 input 设置为一样大小(width和heig ...

随机推荐

  1. 125. Valid Palindrome (Array; Two-Pointers)

    Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignori ...

  2. 398. Random Pick Index随机pick函数

    [抄题]: Given an array of integers with possible duplicates, randomly output the index of a given targ ...

  3. DNS处理模块dnspython

    一.介绍 官网:http://www.dnspython.org/ https://pypi.org/project/dnspython/ dnspython是Python的DNS工具包.它支持几乎所 ...

  4. 2-R型聚类

    将相似的属性聚合在一起 clc, clear; % a = load('E:\a-建模\<数学建模算法与应用>课件资源\数学建模算法与应用\程序及数据\10第10章\gj.txt'); a ...

  5. cannot launch node of type [arbotix_python/arbotix_driver]: arbotix_python

    这个时候提示错误: ERROR: cannot launch node of type [arbotix_python/arbotix_driver]: arbotix_python ROS path ...

  6. Zookeeper使用--Java API

    1  创建节点 创建节点有异步和同步两种方式.无论是异步或者同步,Zookeeper都不支持递归调用,即无法在父节点不存在的情况下创建一个子节点,如在/zk-ephemeral节点不存在的情况下创建/ ...

  7. java读取properties配置文件[转]

    网上文章常见的几种读取.properties文件的方式 1.使用java.util.Properties类的load()方法 示例: InputStream in = lnew BufferedInp ...

  8. IIS相关知识和经验的碎片化记录

    1.IIS(Internet Information Services)网站本机可以访问,局域网其他机器无法访问 导致这个问题之一是防火墙规则,解决办法如下: [开始]打开[控制面板],选择[WIND ...

  9. 白盒测试实践--Day3 12/19/2017

    累计完成任务情况: 阶段内容 参与人 完成静态代码检查结果报告 小靳 完成JUnit脚本编写 小黄 完成CheckStyle检查 小靳 完成代码评审会议纪要和结果报告 小熊.小梁及其他 完成白盒测试用 ...

  10. StackExchange.Redis实现Redis发布订阅

    由于ServiceStack.Redis最新版已经收费,所以现在大家陆陆续续都换到StackExchange.Redis上了,关于StackExchange.Redis详细可以参看Github htt ...