Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Input accept="image/png" is not working in Firefox

jsbin

<input type="file" accept="image/png">

It's expected that the file dialog accepts png files only. But accept="image/png" does not work on Firefox. How can I make it? P.S. It works in Chrome.

like image 840
Frank Fang Avatar asked Jan 01 '14 06:01

Frank Fang


1 Answers

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.

like image 74
Elad Stern Avatar answered Sep 21 '22 13:09

Elad Stern