[RESOLVED] validate-upload file (.net 2.0)
Hi,
There is a requirement to be able to upload files using a website (asp.net 2.0) . There should be a kind of validation on these files before the upload is allowed. What I am not sure of is how can I do any kind of validation on the files before the upload? For example if a file of type excel or .txt is to be uploaded, the website has to first check to see if there are certain data in the file... then if all ok the upload is allowed.
Thanks
Re: validate-upload file (.net 2.0)
Upload the file as usual.
Read the file.
Verify the data using whatever business logic you want.
If it validates, then all's good.
If it does not, then delete the file and return an error message to the user.
So, you will need to upload it to the server first because you can't do anything like this on client side.