IIS Worker Process blocking file

3 posts, 0 answers
  1. Zachary French
    Zachary French avatar
    3 posts
    Member since:
    Apr 2009

    Posted 20 Aug 2010 Link to this post

    I am using a RadAsyncUpload control on a page that allows the user to send emails with attachments.

    I have in place the work around found here


    My radscriptmanager is in the master page, here's my radasyncupload declaration

    HttpHandlerUrl="~/Handlers/RadAsyncUploadWorkAround.ashx" />

    In the code behind,

    I have this in my onInit

    fileUpload.FileUploaded += new FileUploadedEventHandler(uploaded);
    fileUpload.TemporaryFolder = systemDocumentPathRoot;
    //fileUpload.TargetFolder = systemDocumentPathFull;
    fileUpload.Localization.Select = GetResourceString("Browse");

    and for my uploaded method

    List<string> fileNames = new List<string>();
      public void uploaded(object sender, FileUploadedEventArgs args){

     string fileName = @"DocumentFolder" + args.File.FileName;


    on my SendButton event

    System.Net.Mail.MailMessage message = new MailMessage("Zach.French@blackline.com", "Zach.French@Blackline.com", "test", "this is a test");
    foreach(string fileName in fileNames)
          message.Attachments.Add(new Attachment(fileName));
    SmtpClient smtpClient = new SmtpClient();


    for a small files it works fine

    but when I tried a file at about 2MB or more it fails.

    the file is uploaded to the correct temporary location.

    When I click the send button and do the full postback, uploaded is called and the file is saved to the correct location

    When the send button event is called,  an exception is thrown on smtpClient.send(message).

    the quick watch of the exception was print screened and is attached as exception.jpg

    When I go to the file via the file explorer, and try to delete it I get an error message saying the file is in use (see fileinuse.jpg)

    I believe the radasyncupload is still accessing the file or blocking it but I'm not sure.

    Any help would be appreciated.


  2. Genady Sergeev
    Genady Sergeev avatar
    1600 posts

    Posted 25 Aug 2010 Link to this post

    Hi Zachary French,

    I've tried to reproduce the problem, however, no avail. RadAsyncUpload uses the .NET File.Move method in order to move the uploaded file from the temporary to the target folder. In general we don't open any streams to the uploaded file this why I think that the problem might be somewhere else. Anyway, just to be sure, could you please give it a try with the latest internal build? We have tweaked the RadAsyncUpload temporary files handling and this might reflect the error that you experience. More information on how to obtain the latest internal can be found here.

    Sincerely yours,
    Genady Sergeev
    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
  3. Zachary French
    Zachary French avatar
    3 posts
    Member since:
    Apr 2009

    Posted 30 Aug 2010 Link to this post

    It was a .net 3.5 to .net 4.0 issue for smtp client


    thanks for looking into it though

Back to Top