Batch uploading of files fails on some files in the batch: "File not exists"

Last post 05-10-2010, 8:22 PM by cutechat. 5 replies.
Sort Posts: Previous Next
  •  05-10-2010, 12:29 PM 60866

    Batch uploading of files fails on some files in the batch: "File not exists"

    I have the following control markup and codebehind for an instance of the AjaxUploader. On my local dev machine this works fine, but when deployed to our staging server, uploading multiple files at the same time results in an issue where some of the files will upload correctly, but others will fail with the error:

    Server side exception : failed to upload Desert.jpg

    Debug Information:

    System.Exception: File not exists!
       at CuteWebUI.UploadModule.a(HttpContext A_0, Guid A_1)
    For example, two files out of an upload of 8 may fail with this error, while the other 6 seem to work fine. Is there anything I can do to troubleshoot/resolve the issue?
     
    Markup:

    <%@ Register TagPrefix="CuteWebUI" Namespace="CuteWebUI" Assembly="CuteWebUI.AjaxUploader" %>
    <CuteWebUI:Uploader id="Uploader1" runat="server" MultipleFilesUpload="true"
    AutoUseSystemTempFolder="true" OnUploadCompleted="Uploader_OnUploadCompleted"></CuteWebUI:Uploader>
    <script type="text/javascript">
    function CuteWebUI_AjaxUploader_OnError(msg)
    {
    DisplayValidationError($('#validationErrors'), msg);
    return false;
    }
    function CuteWebUI_AjaxUploader_OnTaskError(obj, msg, reason)
    {
    DisplayValidationError($('#validationErrors'), 'Error uploading ' + obj.FileName + ': ' + msg);
    return false;
    }
    </script>
    Code:
    protected void Uploader_OnUploadCompleted(object sender, UploaderEventArgs[] e)
    {
        List<NewUploadedDocument> uploadedDocuments = new List<NewUploadedDocument>();
        for (int i = 0; i < e.Length; ++i)
        {
            var uploadedFile = e[i];
            byte[] fileBytes = new byte[uploadedFile.FileSize];
            using (var stream = uploadedFile.OpenStream())
            {
                stream.Read(fileBytes, 0, uploadedFile.FileSize);
            }
             // Code here to copy the file to a database row
       }
         // Clean up after the uploads
         foreach (var uploadedFile in e)
         {
            uploadedFile.Delete();
        }
    }
  •  05-10-2010, 2:42 PM 60873 in reply to 60866

    Re: Batch uploading of files fails on some files in the batch: "File not exists"

    I checked on another (demo) environment we have, and it works there. One difference is that the stage environment (where the error occurs) is using SSL, while the demo environment (no error) is not using SSL.
     
    Will batch upload work with SSL, or is this a limitation of the control?
  •  05-10-2010, 2:53 PM 60876 in reply to 60873

    Re: Batch uploading of files fails on some files in the batch: "File not exists"

    >>Will batch upload work with SSL, or is this a limitation of the control?
     
    Yes.
     
    We fixed many SSL related issues since last year.  Can you download and upgrade to the latest build then try again?
     
     
    Keep me posted

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  05-10-2010, 3:00 PM 60878 in reply to 60876

    Re: Batch uploading of files fails on some files in the batch: "File not exists"

    We're using version 3.0.0.0, is there a way to make sure we're using the latest build? We purchased the control within the last month, so it shouldn't be an old build.
     
    Edit: Never mind, I was looking at the wrong field. We are using 3.0.20100414, I'll try the 20100505 build (which appears to be the latest?) and report back.
  •  05-10-2010, 3:19 PM 60879 in reply to 60878

    Re: Batch uploading of files fails on some files in the batch: "File not exists"

    Ah, I found the problem -- the stage environment is load-balanced, and the load balancer was causing the uploaded files and the postback to occur on different webservers.
     
    Thanks!
  •  05-10-2010, 8:22 PM 60884 in reply to 60879

    Re: Batch uploading of files fails on some files in the batch: "File not exists"

    Hi,
     
    Yes. load balancing need set a shared folder for the temp directory , or use another uploader provider (for example , the database provider for temp file)
     
    Regards,
    Terry
View as RSS news feed in XML