Re: How to capture the upload event in Insert Image dialog

  •  06-18-2013, 1:35 PM

    Re: How to capture the upload event in Insert Image dialog

    Hi oddball,

     

    The upload control in the insert image dialog has a "FileUploaded" event, you can add your own logic there. 

     

    1. Open fileCuteSoft_Client\CuteEditor\Dialogs\InsertImage.aspx, add the code below into the page OnInit event.

     

      InputFile.FileUploaded += new UploaderEventHandler(InputFile_FileUploaded); 

     

    2. Add the method below into the "InsertImage.aspx", it will fire after uploaded.

     

      void InputFile_FileUploaded(object sender, UploaderEventArgs args)
        {
            //save upload file to a new location
            //args.CopyTo("~/myfolder/"+args.FileName);
        }
     

    But note that, this event will not disable the default upload behavior, it is an addition option to add your own logic.

     

    Another way is add a new upload control there and hide the default one, then the new upload control has nothing default behavior, you can use any logic you need for it.

     

    <ce:uploader id="myUpload" runat="server" ></ce:uploader> 

     

    Regards,

     

    Ken 

     

     

View Complete Thread