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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With