I have an input that I do not want to accept GIFs for. Is it possible to use the accept attribute to block certain types of files? Thanks for the help!
My current set up looks like this: accept="image/*"
I have an input that I do not want to accept GIFs for. Is it possible to use the accept attribute to block certain types of files? Thanks for the help!
My current set up looks like this: accept="image/*"
Is it possible to use the accept attribute to block certain types of files?
No. The user can still select any file at local filesystem, even when accepts
attribute is set. The value at accepts
attribute is only a suggestion to the user. You will need to perform additional checks as to the actual file type at client side before posting data to server and, or perform validation at the server.
See also make ASP.Net file upload secure.