Input accept=“image/png” is not working in Firefox

后端 未结 5 2015
醉梦人生
醉梦人生 2021-01-17 15:37

jsbin


It\'s expected that the file dialog accepts png files only. But accept=\"image

5条回答
  •  一个人的身影
    2021-01-17 16:20

    Read Mozilla Doc here Currently not all browsers go to that deep to support specific file extention, but they all support a file type, like image/video.

    accept
    If the value of the type attribute is file, this attribute indicates the types of files that the server accepts; otherwise it is ignored. The value must be a comma-separated list of unique content type specifiers:
    A valid MIME type with no extensions
    audio/* representing sound files HTML5
    video/* representing video files HTML5
    image/* representing image files HTML5
    

提交回复
热议问题