I am implementing file upload functionality in this way
<html>
<head>
<title>File Uploading Form</title>
</head>
<body>
<h3>File Upload:</h3>
Select a file to upload: <br />
<form action="UploadServlet" method="post"
enctype="multipart/form-data">
<input type="file" name="file" size="50" />
<br />
<input type="submit" value="Upload File" />
</form>
</body>
Now I want to restrict the user with some file types means when browse window will open he will be able to select all the files
except .bin
& .dat
.
Means user will not be able to see that files with type .bin and .bat
others he can see it and can go upload them.
I am familiar with accept
attribute but, but it's not useful in my case because user should be able to select any file type except these two.
So how can achieve this without validation ?
I want to provide such a functionality that when user clicks on browse button and open a browse window to select a file , he should be able to see only files without .bin or .dat extension
Is there any way to do this?
Thanks,