How to change the file extentions allowed?

Last post 05-10-2013, 12:23 PM by Kenneth. 1 replies.
Sort Posts: Previous Next
  •  05-08-2013, 1:37 PM 77395

    How to change the file extentions allowed?

    is there a way to control the message of file extention allowed to somthing else

    instead of the default message?

     

    thanks

     

    Avi 

  •  05-10-2013, 12:23 PM 77408 in reply to 77395

    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 as RSS news feed in XML