Anti-Virus upon upload?

Last post 11-21-2008, 10:31 AM by cutechat. 1 replies.
Sort Posts: Previous Next
  •  11-20-2008, 10:33 PM 46043

    Anti-Virus upon upload?

    Hi guys,
     
    I need to scan the files upon upload. Remove the files and notify the users if infected. I know it's beyond the scope of the ajax-uploader, just wonder if someone can give some good directions how to do it.
     
    Any helps will be appreciated!
     

    Allen
  •  11-21-2008, 10:31 AM 46142 in reply to 46043

    Re: Anti-Virus upon upload?

    Allen:
     
    You can use the OnFileValidating event to write the custom validation code :
     
    <CuteWebUI:UploadAttachments runat="server" ID="Uploader1" OnFileValidating="Uploader1_FileValidating" />
     protected void Uploader1_FileValidating(object sender, UploaderEventArgs args)
     {
          if(!CheckFileStream(args.OpenStream()))
                throw(new Exception("You file is not valid!"));
     }
     
    this exception message would pass to client side , and the uploader would alert it to the users.
     
    Regards,
    Terry
View as RSS news feed in XML