You need to sign in to do that
Don't have an account?

inputFile accept attribute
What is the appropriate value for the accept attribute on the inputFile standard component? I tried "text/plain", "*.txt" and "txt" but none of that works, the browse dialog always shows all files of all types, IE and FireFox.
This is not honoured correctly by any of the major browsers. The recommendation is to validate the file type server-side.
There's more information at:
http://www.cs.tut.fi/~jkorpela/forms/file.html#filter
All Answers
This is not honoured correctly by any of the major browsers. The recommendation is to validate the file type server-side.
There's more information at:
http://www.cs.tut.fi/~jkorpela/forms/file.html#filter
Yeah I just realized that the inputFile component produces the file input html tag, I don't know what I was thinking. I do have my server side validation in place so I guess I'm done. Thanks Bob!
You could also setup Javascript validation with and onChange binding that reads the value of the input file and compares the extension via regex? To alert the user before wasting time uploading the file.