HTML & CSS
According to MDN accept=[MIME type] is supported in Firefox. However, I tried the following to no avail:
<input type="file" accept="text/html">
It doesn't filter the HTML files: demo.
Is it a bug or am I missing something?
It doesn't help. Thanks, anyway!
hope this helps
Therefore the file type needs to be tested on the server regardless and once you have the file type being tested there it then becomes irrelevant whether the attribute in the HTML works or not.
The browser support to the accept attribute is poor and buggy, and felgall is right anyway.
On the other hand, w3schools is not a very recommendable reference to solve this (or any other problem). You'd better rely on the Reference section of this site. And in this particular case the following page:
Just have a look at the compatibility and see that it is buggy in all the browsers.
This is why, although I will often check the MDN for known things, I don't trust it for many attributes that I can't tell if they are custom to Mozilla or not. MDN treats both custom and spec things the same, making it almost never my last stop.
This topic is now closed. New replies are no longer allowed.