Re: Validating and providing feedback

  •  11-23-2009, 3:09 PM

    Re: Validating and providing feedback

    I tried method 2 and it seems to work just fine.  In the FileValidating event, I used a string that tells the user that the file already exists and so the file will not be uploaded.  I then call args.delete() to remove that file so it is not copied.  Since my uploaded files may or may not be duplicates, I need to test for a message in the alert and only display an alert if there is a message, i.e., the duplicate message I added in the FileValidating event:
     
     
    1. If System.IO.File.Exists(fullFileName) Then  
    2.    'The file already exists on the server so we need to delete it from the temporary  
    3.     '  upload directory (so it doens't get called in the FileUploaded event) and alert the user  
    4.   
    5.                  UploadAttachments1.SetValidationServerData(String.Format("A file named {0} already exists and will not be uploaded.", args.FileName))  
    6. args.Delete()  
    7.   
    8. End If
View Complete Thread