3
Using HTML only Is not possible.
This is because file search window in tag input file
is from the Operating System. The attribute accept
reports to the Operating System the type or types of files accepted initially, helping user to find accepted files, but nothing prevents "All files" option to be selected.
Only programs running directly on the operating system and with permission to explore files on the computer can do this kind of limitation as you can see in the image below:
If your app could communicate with any other being executed in the Operating System this would be possible.
takes the file name, and cuts the string the last 4 characters (which will be the file extension), then just have an array of extensions that are accepted, and check if the extension is in the array, if it is registered, if not, warns the user that the file n has been sent
– Matheus Lopes Marques
This validation is already done, but I just wanted to know if it is possible to delete 'all files' from select in the explorer, if I am not mistaken, I’ve seen this option disabled when choosing files.
– Felipe Duarte
@Felipeduarte you may have seen this option unavailable or disabled in a specific program made in another language. In the browser, at least in the largest there is no such limitation.
– Rafael Mena Barreto