zoukankan      html  css  js  c++  java
  • input file 上传文件类型控制

    文件类型 accept

    *.3gpp audio/3gpp, video/3gpp
    .ac3 audio/ac3
    .asf allpication/vnd.ms-asf
    .au audio/basic
    .css text/css
    .csv text/csv
    .doc application/msword
    .dot application/msword
    .dtd application/xml-dtd
    .dwg image/vnd.dwg
    .dxf image/vnd.dxf
    .gif image/gif
    .htm text/html
    .html text/html
    .jp2 image/jp2
    .jpe image/jpeg
    .jpeg image/jpeg
    .jpg image/jpeg
    .js text/javascript, application/javascript
    .json application/json
    .mp2 audio/mpeg, video/mpeg
    .mp3 audio/mpeg
    .mp4 audio/mp4, video/mp4
    .mpeg video/mpeg
    .mpg video/mpeg
    .mpp application/vnd.ms-project
    .ogg application/ogg, audio/ogg
    .pdf application/pdf
    .png image/png
    .pot application/vnd.ms-powerpoint
    .pps application/vnd.ms-powerpoint
    .ppt application/vnd.ms-powerpoint
    .rtf application/rtf, text/rtf
    .svf image/vnd.svf
    .tif image/tiff
    .tiff image/tiff
    .txt text/plain
    .wdb application/vnd.ms-works
    .wps application/vnd.ms-works
    .xhtml application/xhtml+xml
    .xlc application/vnd.ms-excel
    .xlm application/vnd.ms-excel
    .xls application/vnd.ms-excel
    .xlt application/vnd.ms-excel
    .xlw application/vnd.ms-excel
    .xml text/xml, application/xml
    .zip application/zip
    .xlsx application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
    .xltx application/vnd.openxmlformats-officedocument.spreadsheetml.template
    .potx application/vnd.openxmlformats-officedocument.presentationml.template
    .ppsx application/vnd.openxmlformats-officedocument.presentationml.slideshow
    .pptx application/vnd.openxmlformats-officedocument.presentationml.presentation
    .sldx application/vnd.openxmlformats-officedocument.presentationml.slide
    .docx application/vnd.openxmlformats-officedocument.wordprocessingml.document
    .dotx application/vnd.openxmlformats-officedocument.wordprocessingml.template
    .xlsm application/vnd.ms-excel.addin.macroEnabled.12
    .xlsb application/vnd.ms-excel.sheet.binary.macroEnabled.12

    追加!!!!!!!

    在上传图片时, accept不要设置成 accept="image/png,image/jpg,image/jpeg"!

    后果: 浏览图片时不会自动进入相册,默认打开的是最近使用文档文件夹 但是最近的显示为空,而且图片会变灰选择不了,因为这个,我TM被老板骂惨了!5555555

    直接设置成 accept="image/*" ;

    望周知.

  • 相关阅读:
    发现对各类项目有用的不同JavaScript的Web UI
    PowerDesigner 15.1 安装步骤详细图解及破解
    数据库设计工具PowerDesigner基础普及
    Vistual Studio 2010(VS2010)安装 MVC3.0具体方法
    pb的网络资源【转】
    powerbuider11 C/S 转换为B/S
    转:将可执行文件注册成系统windows服务
    WCF绑定类型选择(转)
    (转)找增强方法总结
    ALV简单模板1
  • 原文地址:https://www.cnblogs.com/spotman/p/11653294.html
Copyright © 2011-2022 走看看