Re: Maximum number of files to be uploaded

  •  03-11-2009, 6:52 AM

    Re: Maximum number of files to be uploaded

    Hi,
     
    Are you using the last version ?
     
    The last version already would automatically replace the file if the MultipleFilesUpload set to flase
     
    Please check this sample:
     
     

     
     
    1. <%@ Page Language="C#" %>  
    2. <%@ Register TagPrefix="CuteWebUI" Namespace="CuteWebUI" Assembly="CuteWebUI.AjaxUploader" %>  
    3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
    4. <html xmlns="http://www.w3.org/1999/xhtml">  
    5. <head runat="server">  
    6.     <title>Sample</title>  
    7. </head>  
    8. <body>  
    9.     <form id="form1" runat="server">  
    10.         <div>  
    11.             <CuteWebUI:UploadAttachments runat="server"    
    12. ID="Uploader1" ManualStartUpload="true" MultipleFilesUpload="false" />  
    13.             <hr />  
    14.             <asp:Button runat="server" ID="SubmitButton"    
    15. OnClientClick="return submitbutton_click()"  
    16.                 Text="Submit" />  
    17.         </div>  
    18.     </form>  
    19. </body>  
    20.   
    21. <script type="text/javascript">  
    22.     function submitbutton_click()   
    23.     {   
    24.         var submitbutton=document.getElementById('<%=SubmitButton.ClientID %>');   
    25.         var uploadobj=document.getElementById('<%=Uploader1.ClientID %>');   
    26.         if(!window.filesuploaded)   
    27.         {   
    28.             if(uploadobj.getqueuecount()>0)   
    29.             {   
    30.                 uploadobj.startupload();   
    31.             }   
    32.             else   
    33.             {   
    34.                 alert("Please browse files for upload");   
    35.             }   
    36.             return false;   
    37.         }   
    38.         window.filesuploaded=false;   
    39.         return true;   
    40.     }   
    41.     function CuteWebUI_AjaxUploader_OnPostback()   
    42.     {   
    43.         window.filesuploaded=true;   
    44.         var submitbutton=document.getElementById('<%=SubmitButton.ClientID %>');   
    45.         submitbutton.click();   
    46.         return false;   
    47.     }   
    48. </script>  
    49.   
    50. </html>  
    Regards,
    Terry
     
View Complete Thread