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

后端 未结 5 1954
醉梦人生
醉梦人生 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:15

    Apparently there's an issue specific to Firefox with some extension types. You can read more about this bug here.

    The latest update on this bug is from a couple of months ago and it seems to not yet be resolved. For now, I would suggest server-side file-checking, or at the very minimum you can use JavaScript to verify the file's extension before it gets uploaded.

提交回复
热议问题