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:
- If System.IO.File.Exists(fullFileName) Then
-
-
-
- UploadAttachments1.SetValidationServerData(String.Format("A file named {0} already exists and will not be uploaded.", args.FileName))
- args.Delete()
-
- End If