Hi KatlimRuiz,
To achieve your requirement, I suggest you verify the file extension in API CuteWebUI_AjaxUploader_OnSelect and custom the verify logic there. like the example below, try to upload a file (not jpg), it should shows the error message format what you need.
- <%@ Page Language="C#" Title="Customize the queue UI" %>
-
- <%@ Register TagPrefix="CuteWebUI" Namespace="CuteWebUI" Assembly="CuteWebUI.AjaxUploader" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
-
- <script runat="server">
- protected override void OnLoad(EventArgs e)
- {
- h1.Value = UploadAttachments1.ValidateOption.AllowedFileExtensions;
- base.OnLoad(e);
- }
- </script>
-
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head id="Head1" runat="server">
- </head>
- <body>
- <form id="Form1" runat="server">
- <div>
- <CuteWebUI:UploadAttachments runat="server" ID="UploadAttachments1">
- <ValidateOption AllowedFileExtensions="jpg" />
- </CuteWebUI:UploadAttachments>
- <asp:HiddenField ID="h1" runat="server" />
- </div>
- </form>
- </body>
- </html>
-
- <script>
- var h1=document.getElementById("<%= h1.ClientID %>");
-
- function CuteWebUI_AjaxUploader_OnSelect(files)
- {
- for(var i=0;i<files.length;i++)
- {
- if(files[i].FileName.substring(files[i].FileName.lastIndexOf(".")+1)!="jpg")
- {
-
-
- alert("The file "+ files[i].FileName+ " is not supported. Only the following extensions "+ h1.value);
- return false;
- }
- }
- }
- </script>
Regards,
Ken