Re: Upload error message "File size (undefined B) is to large. The maximum file size allowed is set to: 10.00MB."

  •  02-28-2011, 9:10 PM

    Re: Upload error message "File size (undefined B) is to large. The maximum file size allowed is set to: 10.00MB."

    Hi rmacfadyen,
     
    The example below shows you how to catch the error and show your customize information.
     
    1. <%@ Page Language="C#" %>  
    2.   
    3. <%@ Register Assembly="CuteWebUI.AjaxUploader" Namespace="CuteWebUI" TagPrefix="CuteWebUI" %>  
    4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
    5. <html xmlns="http://www.w3.org/1999/xhtml">  
    6. <head runat="server">  
    7.     <title>Untitled Page</title>  
    8. </head>  
    9. <body>  
    10.     <form id="form1" runat="server">  
    11.         <div>  
    12.             <CuteWebUI:Uploader ID="uploader1" runat="server">  
    13.                 <ValidateOption MaxSizeKB="10" />  
    14.             </CuteWebUI:Uploader>  
    15.         </div>  
    16.     </form>  
    17. </body>  
    18. </html>  
    19. <script>  
    20.    function CuteWebUI_AjaxUploader_OnError(msg)  
    21.     {  
    22.         if(msg.indexOf("The maximum file size allowed is set to")!=-1)  
    23.         {  
    24.         //show the message you want  
    25.             alert("The file is locked");  
    26.            return false;  
    27.         }  
    28.     }  
    29. </script> 
     
    Regards,
     
    ken
View Complete Thread