On the FileUploaded event I'm doing some validation (checking file type and whatnot), and in case there's an error, I want to completely dispose of the file that was uploaded. To achieve this I'm calling .ClearFile() and then returning from the event handler without further action.
That doesn't seem to be enough, as I'm faced with 2 problems:
- The "filename (size)" text still appears in front of the upload Button. Since I want to make it clear the upload failed, I don't want this to show.
- After uploading a file that triggers the upload failure described, if I then upload a valid file, the uploader (sometimes) falls over. Basically the bit of code I have in place to hide the uploader and showing the file information doesn't get run because I end up with the file complete progress information.
Is there something I'm missing in my "uploader reset"?
Is there a way to achieve what I'm trying to do?
António Farinha
http://antoniofarinha.com