The uploader freezes IE7 when 500 files are selected.

Last post 11-06-2008, 8:07 PM by cutechat. 4 replies.
Sort Posts: Previous Next
  •  11-05-2008, 12:01 PM 45435

    The uploader freezes IE7 when 500 files are selected.

     
    My application need to allow our customers to upload a large number of files in one round (> 5000).
    I tried the multi file test application which seem to:
    1) Freeze the browser
    2) Creates a long list of files to be uploaded. (too long to see any of the progress bar)
     
    Q1:
    Is there a hard limitation anywhere - or should this have worked ?
     
    Q2:
    I would like to have the progress bar show the progress of the complete upload rather than every single file.
    Is that possible?
     
    Q3:
    I assume directory uploads require some client component, such that the Ajax uploader will not do that ever ?
     
    Thanks
    jl
     
     
     
  •  11-06-2008, 6:46 AM 45459 in reply to 45435

    Re: The uploader freezes IE7 when 500 files are selected.

    Hi,
     
    To select multiple files in a same directory , the browser requires the Flash/Silverlight .
     
    Please try this sample:
     
     

    <%@ Page Language="C#" Title="Uploading multiple files like GMail" %>

    <script runat="server">
      
     void InsertMsg(string msg)
     {
      ListBoxEvents.Items.Insert(0, msg);
      ListBoxEvents.SelectedIndex = 0;
     }

     void Uploader_FileUploaded(object sender, UploaderEventArgs args)
     {
      InsertMsg("Uploaded file : " + args.FileName + " - " + args.FileSize);
     }

    </script>

    <html>
    <head runat="server">
    </head>
    <body>
     <form runat="server">
      <h2>
       Uploading multiple files (Limit the maximum allowed number of files to be uploaded)</h2>
      <p>
       This example shows you how to limit the maximum allowed number of files to be uploaded.
       In the following example, you can only upload 3 files.</p>
      <br />
      <CuteWebUI:Uploader runat="server" ID="Uploader1" InsertText="Upload Multiple files Now"
       MultipleFilesUpload="true" OnFileUploaded="Uploader_FileUploaded">
      </CuteWebUI:Uploader>
      <div id="myqueueui" style="display: none">
      </div>
      <br />
      <br />
      <div>
       Server Trace:
       <br />
       <asp:ListBox runat="server" ID="ListBoxEvents" Width="400"></asp:ListBox>
      </div>

      <script type="text/javascript">
     function CuteWebUI_AjaxUploader_OnQueueUI(list)
     {
      var myqueueui=document.getElementById("myqueueui");

      if(list.length<10)
      {
       myqueueui.style.display="none";
       //use default UI
       return true;
      }
      
      var standby=0;
      
      for(var i=0;i<list.length;i++)
      {
       var name=list[i ].FileName
       var size=list[i ].FileSize // (or -1)
       var stat=list[i ].Status // Finish|Error|Upload|Queue
       var func=list[i ].Cancel;
       
       if(stat=="Queue")
        standby++;
      }

      myqueueui.innerHTML= "Uploading.. "+(list.length-standby)+"/"+list.length+ " files.";
      myqueueui.style.display="";
      
      //hide the default UI
      return false;
     }
     function CuteWebUI_AjaxUploader_OnProgress(enable,filename,starttime,sentsize,totalsize)
     {
      //var myqueueui=document.getElementById("myqueueui");
      
      //if use the default queue UI , then use the default progress bar too.
      //if(myqueueui.style.display=="none")
      // return true;
       
      //hide the default progress bar.
      //return false;
     }
      </script>

     </form>
    </body>
    </html>

     
    Regards,
    Terry
  •  11-06-2008, 12:25 PM 45474 in reply to 45459

    Re: The uploader freezes IE7 when 500 files are selected.

     
    Thanks Terry,
     
    I am able to select multiple files (so I guess it is using flash?)
    The freeze seem to be caused by the JavaScript handling in the default OnQueueUI.
     
    So are there APIs for calculating remaining upload time ?
    And is it possible to control the progress bar (to display remaining bytes to upload / total bytes for example) ?
     
    And another problem:
    After each file is uploaded is uploaded it seems that a GET to the server is performed. I hear a "click" for each uploaded file.
    Anyway around that ?
     
    jl
  •  11-06-2008, 12:27 PM 45475 in reply to 45474

    Re: The uploader freezes IE7 when 500 files are selected.

     
    Another thing:
     
    After the upload of all the selected files, a list of the uploaded files are shown with a "Remove" option.
    That looks a little strange with 500 files.
    I assume there is a JavaScript method to override that too?
     
    jl
  •  11-06-2008, 8:07 PM 45486 in reply to 45474

    Re: The uploader freezes IE7 when 500 files are selected.

    jl,
     
    When use the javascript to do the customize progress UI,
     
    The developer can calculate the total time remaining.
     
    I will provide a better example next week.
     
    --
     
    There is a POST after each file. That's is not nessasary and can use XMLHttp to do that.
     
    We will improve this later. Thanks.
     
    --
     
    If you are using UploadAttachments , It would show a table wich is generated at server side.
     
    You can draw a new table with UploadAttachments.Items data.
     
    But currently we don't have property to hide that table.
     
    Regards,
    Terry
     
View as RSS news feed in XML