I am getting the following error when using the file uploaded method: The process cannot access the file because it is being used by another process
I am attempting to check the file for a virus during the upload process. How would I go about resolving this issue?
protected void AsyncUploadEo_FileUploaded(object sender, FileUploadedEventArgs e) { byte[] bytes = new byte[e.File.InputStream.Length]; e.File.InputStream.Read(bytes, 0, (int)(e.File.InputStream.Length)); bool bFileIsVirusFree = Helper.IsFileVirusFree(bytes, e.File.GetExtension()); if (!bFileIsVirusFree) { lblEoError.Text = Helper.FILE_HAS_VIRUS_MESSAGE; } } I am attempting to check the file for a virus during the upload process. How would I go about resolving this issue?