zoukankan      html  css  js  c++  java
  • html 5 如何限制上传的文件类型 (uploadifive)

    可以直接设置input标签的accept属性来限制上传文件的类型

    
    <input type="file" accept="application/msword" ><br><br>accept属性列表<br>
    • 1
    • 2

    1.accept=”application/msexcel”
    2.accept=”application/msword”
    3.accept=”application/pdf”
    4.accept=”application/poscript”
    5.accept=”application/rtf”
    6.accept=”application/x-zip-compressed”
    7.accept=”audio/basic”
    8.accept=”audio/x-aiff”
    9.accept=”audio/x-mpeg”
    10.accept=”audio/x-pn/realaudio”
    11.accept=”audio/x-waw”
    12.accept=”image/gif”
    13.accept=”image/jpeg”
    14.accept=”image/tiff”
    15.accept=”image/x-ms-bmp”
    16.accept=”image/x-photo-cd”
    17.accept=”image/x-png”
    18.accept=”image/x-portablebitmap”
    19.accept=”image/x-portable-greymap”
    20.accept=”image/x-portable-pixmap”
    21.accept=”image/x-rgb”
    22.accept=”text/html”
    23.accept=”text/plain”
    24.accept=”video/quicktime”
    25.accept=”video/x-mpeg2”
    26.accept=”video/x-msvideo”

    如果限制上传的文件为图片格式,则可以直接写成:accept = ‘image/*’;

  • 相关阅读:
    机器学习数据
    偏差和方差
    numpy基础
    卷积神经网路
    深度学习基础
    Iris数据集
    SVM-SVR
    Java之日期处理
    MySQL笔记
    在Eclipse中运行的时候出现launching/Building
  • 原文地址:https://www.cnblogs.com/mouseleo/p/8616322.html
Copyright © 2011-2022 走看看