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

4 posts, 0 answers
  1. Atlas
    Atlas avatar
    97 posts
    Member since:
    Jun 2009

    Posted 31 Aug 2010 Link to this post

    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?
  2. Atlas
    Atlas avatar
    97 posts
    Member since:
    Jun 2009

    Posted 01 Sep 2010 Link to this post

    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?
  3. h@r!
    h@r! avatar
    20 posts
    Member since:
    Aug 2010

    Posted 06 Sep 2010 Link to this post

    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!.
  4. Yana
    Admin
    Yana avatar
    4993 posts

    Posted 06 Sep 2010 Link to this post

    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
Back to Top