Im working with a co-worker on Visual Studio, using the file upload control to allow the user to upload a file to the server, however I can’t seem to find a way to validate the file before allowing the upload.
For example I would like to stop them if they are trying to upload a file that is not relevant to their problem.
I am just starting on the asp.net side of things myself, so any shove in the right direction would be appreciated.
The default asp.net fileupload control does not provide this check.
You can use a RegularExpressionValidator to validate the extension.
The html
acceptattribute can come handy, but since this is not natively supported, you will have to add it yourself.