This is a migrated thread and some comments may be shown as answers.

The process cannot access the file because it is being used by another process

3 Answers 121 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Atlas
Top achievements
Rank 1
Atlas asked on 31 Aug 2010, 08:09 PM
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
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?

3 Answers, 1 is accepted

Sort by
0
Atlas
Top achievements
Rank 1
answered on 02 Sep 2010, 01:17 AM
Hey Telerik,
any idea how to resolve this?

Would this be the right place to do something like this?

Out of curiosity,
why does the asynch upload place the file in a temp folder before saving it to a permanent location?
Does the temp file path need to be located within the root of the website?
0
h@r!
Top achievements
Rank 1
answered on 06 Sep 2010, 07:35 AM
Hi Nano,

Just give a try by removing your code from AsyncUploadEo_FileUploaded event to the event where the Upload button or Save button is called.I hope it should work.I haven't tried out but just give a try.

Thanks,
h@r!.
0
Yana
Telerik team
answered on 06 Sep 2010, 08:49 AM
Hello  Nano,

I've tried to reproduce this issue with the provided code but to no avail. Could you please send us a sample page demonstrating the problem in the support thread so we can test it locally? Thanks

Greetings,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
AsyncUpload
Asked by
Atlas
Top achievements
Rank 1
Answers by
Atlas
Top achievements
Rank 1
h@r!
Top achievements
Rank 1
Yana
Telerik team
Share this question
or