Process Files Individually

Last post 05-06-2009, 3:58 PM by rob.bartlett. 11 replies.
Sort Posts: Previous Next
  •  04-14-2009, 12:05 AM 51057

    Process Files Individually

    Hi Wanted to know if the below scenario is possible.
     
    1: Similar to your Start-uploading-manually.aspx example I want to upload a list of files manually
    2: After selecting the files I want to process them 1 at a time and provide real time feedback
    3: When I click the submit button to upload the files this is what I want to happen
          a: A spiner appears on the 1st row. File is uploaded to server. I do some process with the uploaded file and when this is over the spinner turns into a checkbox
          b: Now the above step a should repeat for every file which I have selected.
     
     
    Is it possible to build a UI like the above using Ajax Uploader. Thanks
  •  04-14-2009, 7:36 AM 51066 in reply to 51057

    Re: Process Files Individually

    Hi,
     
    Your request is very useful.
     
    Currently the client side do not provide event for each file.
     
    We will add that event API , and provide sample for your request soon.
     
    Regards,
    Terry
     
  •  04-14-2009, 8:20 AM 51070 in reply to 51066

    Re: Process Files Individually

    Hi Terry
     
    Thanks for getting back. Can you let me know what kind of time frame are we talking about here. A week, month(s)....
    The above functionality is crucial to a new application which we are developing.
  •  04-14-2009, 8:21 AM 51071 in reply to 51070

    Re: Process Files Individually

    Hi,
     
    It will within 1 week.
     
    Regards
    Terry
  •  04-14-2009, 11:36 AM 51078 in reply to 51071

    Re: Process Files Individually

    Perfect. You guys rock :)
  •  04-29-2009, 10:21 AM 51650 in reply to 51078

    Re: Process Files Individually

    Hi,
     
    I need to do something similar and was wondering how the update was going. Is this available now?
     
    thanks
     
    peter
     
  •  04-29-2009, 10:47 AM 51657 in reply to 51650

    Re: Process Files Individually

    I am also very interested in using a similiar technique.  My backend processing seems to happen pretty quick so I've been using the file_validating event to do my processing after each upload.  It works but I would like to hook it into the progress indicator as well.
     
    Thanks for your great product and excellent support!
  •  04-29-2009, 11:25 AM 51661 in reply to 51071

    Re: Process Files Individually

    This is exactly what I need too.  Week's up. ;) Is it available?
  •  04-29-2009, 1:15 PM 51664 in reply to 51661

    Re: Process Files Individually

    rob.bartlett,
     
    We are still working on this issue and will finish it within this week.

    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-04-2009, 11:18 AM 51789 in reply to 51664

    Re: Process Files Individually

    Did this get finished last week?
  •  05-05-2009, 2:07 PM 51835 in reply to 51789

    Re: Process Files Individually

    Hi all,
     
    Please download the last version.
     
    Now uploader provide 3 new javascript event , here is an example for it :
     
    1. <%@ Page Language="C#" %>  
    2.   
    3. <%@ Register TagPrefix="CuteWebUI" Namespace="CuteWebUI" Assembly="CuteWebUI.AjaxUploader" %>  
    4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
    5.   
    6. <script runat="server">  
    7.        
    8.     protected override void OnInit(EventArgs e)   
    9.     {   
    10.         if (Request.HttpMethod == "POST" && !Page.IsPostBack)   
    11.         {   
    12.             string guidstr=Request.Form["ajaxfileguid"];   
    13.             if (guidstr != null)   
    14.             {   
    15.                 //OK it's ajax call, handle it and end response:   
    16.                 Guid guid = new Guid(guidstr);   
    17.                 ServerAjaxProcessFile(guid);   
    18.             }   
    19.         }   
    20.         base.OnInit(e);   
    21.     }   
    22.   
    23.     private void ServerAjaxProcessFile(Guid guid)   
    24.     {   
    25.         //use MvcUploader to get file by guid:   
    26.         CuteWebUI.MvcUploader uploader = new MvcUploader(Context);   
    27.         CuteWebUI.MvcUploadFile file = uploader.GetUploadedFile(guid);   
    28.   
    29.         //process it   
    30.         //file.MoveTo("somewhere/filename.ext")   
    31.         file.Delete();   
    32.            
    33.         Response.Write("Server side message : File uploaded : " + file.FileName);   
    34.         Response.End();   
    35.     }   
    36.   
    37. </script>  
    38.   
    39. <html xmlns="http://www.w3.org/1999/xhtml">  
    40. <head runat="server">  
    41.     <title>Untitled Page</title>  
    42. </head>  
    43. <body>  
    44.     <form id="form1" runat="server">  
    45.   
    46.         <div>  
    47.             <CuteWebUI:Uploader runat="server" ID="Uploader1" MultipleFilesUpload="true">  
    48.             </CuteWebUI:Uploader>  
    49.         </div>  
    50.         <div id="statusdiv">  
    51.         </div>  
    52.     </form>  
    53.   
    54.     <script type="text/javascript">  
    55.        
    56.     function ShowMessage(msg)   
    57.     {   
    58.         var statusdiv=document.getElementById("statusdiv");   
    59.         statusdiv.innerHTML="";   
    60.         statusdiv.appendChild(document.createTextNode(msg));   
    61.     }   
    62.        
    63.     function ClientAjaxProcessFile(guid)   
    64.     {   
    65.         var xh;   
    66.         if(window.XMLHttpRequest)   
    67.             xh=new XMLHttpRequest();   
    68.         else   
    69.             xh=new ActiveXObject("Microsoft.XMLHTTP");   
    70.            
    71.         //this is just an sample, use current page to handle the request   
    72.         var ajaxurl=document.forms["form1"].action;   
    73.         xh.open("POST",ajaxurl,false);   
    74.         xh.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8");   
    75.         xh.send("ajaxfileguid="+guid);   
    76.         alert(xh.responseText);   
    77.     }   
    78.   
    79.     function CuteWebUI_AjaxUploader_OnTaskStart(obj)   
    80.     {   
    81.         ShowMessage("Start : "+obj.FileName);   
    82.     }   
    83.     function CuteWebUI_AjaxUploader_OnTaskComplete(obj)   
    84.     {   
    85.         ShowMessage("Complete : "+obj.FileName+" : "+obj.FileGuid);   
    86.            
    87.         ClientAjaxProcessFile(obj.FileGuid);   
    88.     }   
    89.     function CuteWebUI_AjaxUploader_OnTaskError(obj,msg,reason)   
    90.     {   
    91.         if(msg==null)msg="File has been cancelled";   
    92.         ShowMessage("Error : "+obj.FileName+" : "+msg);   
    93.     }   
    94.        
    95.     function CuteWebUI_AjaxUploader_OnPostback()   
    96.     {   
    97.         //clear the queue   
    98.         this.reset();   
    99.         //cancel postback while the ajax call have processed the files.   
    100.         return false;   
    101.     }   
    102.        
    103.     </script>  
    104.   
    105. </body>  
    106. </html>  

     
    Regards,
    Terry
     
     
  •  05-06-2009, 3:58 PM 51894 in reply to 51835

    Re: Process Files Individually

    Thanks.  That worked nicely.
View as RSS news feed in XML