Re: Filename pattern

  •  07-31-2012, 8:24 AM

    Re: Filename pattern

    Hi Luuuukke,
     
    You can limit the file name by your own logic in API "CuteWebUI_AjaxUploader_OnSelect" and use method Cancel() to remove it if not match your request. Please try the example below.
     
    "files" is the selected file list. files[i].FileName is the upload file name. 
     
    More detail about the API please refer to http://www.ajaxuploader.com/document/scr/JavaScript-API.htm 
     
    1. <%@ Page Language="C#" %>  
    2.   
    3. <%@ Register Namespace="CuteWebUI" TagPrefix="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. <html xmlns="http://www.w3.org/1999/xhtml">  
    6. <head id="Head1" runat="server">  
    7.     <title>example</title>  
    8. </head>  
    9.   
    10. <body>  
    11.     <form id="form1" runat="server">  
    12.         <CuteWebUI:UploadAttachments ID="uploader1" runat="server">  
    13.         </CuteWebUI:UploadAttachments>  
    14.     </form>  
    15. </body>  
    16. </html>  
    17. <script>  
    18. function CuteWebUI_AjaxUploader_OnSelect(files)  
    19. {  
    20.     for(var i=0;i<files.length;i++)  
    21.     {  
    22.         if(files[i].FileName=="181.gif")  
    23.         {  
    24.             files[i].Cancel();  
    25.         }  
    26.     }  
    27. }  
    28. </script>  
     
View Complete Thread