Re: How to change the file extentions allowed?

  •  05-10-2013, 12:23 PM

    Re: How to change the file extentions allowed?

    Hi aviweiss,

     

    You can ctach the error and show you own error message.

     

    To catch uploader error, you need to use CuteWebUI_AjaxUploader_OnTaskError or CuteWebUI_AjaxUploader_OnError event.


    Example:


    <%@ Page Language="C#" %>
    <%@ Register TagPrefix="CuteWebUI" Namespace="CuteWebUI" Assembly="CuteWebUI.AjaxUploader" %>
    <script type="text/javascript">
        function CuteWebUI_AjaxUploader_OnError(msg)
        {
             alert("global error:"+msg);
             return false;
        }
        function CuteWebUI_AjaxUploader_OnTaskError(obj,msg,reason) 
        {
            alert("file error:"+obj.FileName+" , "+msg);
            return false;
        }
    </script>
    <script runat="server">
          void Uploader_FileUploaded(object sender, UploaderEventArgs args)
          {
                args.MoveTo(Server.MapPath("~/Uploads/"));
          }
    </script>
    <html>
    <head>
    </head>
    <body>
    <form runat="server" id="theForm">
          <CuteWebUI:Uploader runat="server" ID="Uploader1" 
                InsertText="Upload File" OnFileUploaded="Uploader_FileUploaded">
          </CuteWebUI:Uploader>
    </form>
    </body>
    </html>
                     

    Regards,

     

    Ken 

View Complete Thread