<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. ArcGIS js api三种查询功能

    转自https://blog.csdn.net/lovecarpenter/article/details/52669777

  2. Spring Data JPA + layui的前台分页插件layPage实现页面的分页

    一.后台代码: 1.1 controller层代码 @RequestMapping("/xxxxxx") public String showInformationCode(Str ...

  3. qt的exe文件查找依赖的dll

    用qtcreater编译完工程生成的exe文件往往会依赖dll文件.如何一次定位exe文件所以依赖的所有dll文件呢,今天发现了软件叫hap-depends. 截图如下: 用这个软件打开exe文件就会 ...

  4. 最长的相同节点值路径 · Longest Univalue Path

    [抄题]: Given a binary tree, find the length of the longest path where each node in the path has the s ...

  5. Linux Virtualization with Xen

    Xen is the new virtualization kid on the block. It's gaining visibility and importance at a speed on ...

  6. tp5循环+判断

  7. java简单例子介绍IOC和AOP

    IOC和AOP的一些基本概念 介绍 IOC 一.什么是IOC IoC就是Inversion of Control,控制反转.在Java开发中,IoC意味着将你设计好的类交给系统去控制,而不是在你的类内 ...

  8. DataTable数据分页

    using System;using System.Collections.Generic;using System.Data;using System.Linq;using System.Refle ...

  9. poj 3304 Segments (题意理解出错,错误的只枚举了过线段的直线)

    //枚举过每一条线段的直线, //再判断其他线段的点在直线上或被直线穿过 //即求直线与线段相交(叉积) #include<stdio.h> #include<math.h> ...

  10. 04 Rabbits and Recurrence Relations

    Problem A sequence is an ordered collection of objects (usually numbers), which are allowed to repea ...