I am using struts *<html:file>* to upload a file.
When i click on browse button, one dialog box ie choose file window opens.
But initially, it shows All Files (*.*) in File types text box. But i want to restrict the user there only to select some specific types.
I use accept attribute of <html:file> tag and provide value like "*application/pdf,image/jpeg*".
But it is showing All Files in that choose file window.
can anybody help me on this?
there were a way of doing that but using the accept attribute in the input tag like <input type="file" accept"your MIME types">
but many browsers ignore this attribute and still show all file types.
another way to solve the problem is to validate the file selected after user clicks ok by java script code.