Insert Image but not from a directory or a website.

  •  01-20-2009, 6:44 AM

    Insert Image but not from a directory or a website.

    I have implemented CuteEDitor ASP on my portal. My customers upload their images not in a directory but in a Access DB as binary file.

    In the toolbar of CuteEditor, I have Disabled the Itemlist like ImageGallery, InsertFlash ... and all that stuff. I have customized the toolbar and added one custom button with this code:

    <%...
    editor.CustomAddons = "<img title=""Using oncommand"" class=""CuteEditorButton"" onmouseover=""CuteEditor_ButtonCommandOver(this)"" onmouseout=""CuteEditor_ButtonCommandOut(this)"" onmousedown=""CuteEditor_ButtonCommandDown(this)"" onmouseup=""CuteEditor_ButtonCommandUp(this)"" ondragstart=""CuteEditor_CancelEvent()"" Command=""MyCmd"" src=""
    http://localhost/Carpenters/CarpentersAlbumPicturesLogo.asp?idCarp=2530"" width=""20"" height=""20""  />"
    %>
     
       <script type="text/javascript">  
          var editor1=document.getElementById("<%= editor.ClientID %>");
       function CuteEditor_OnCommand(editor,command,ui,value)
          {
              //handle the command by yourself
              if(command=="MyCmd")
             {          
        
              editor.ExecCommand("InsertImage");
              return true;
           }
            }
            </script> 
     

    Normally, to let display the image, it calls a script with this command: <img src="http://localhost/Carpenters/CarpentersAlbumPicturesLogo.asp?idCarp=2530">.

     

    My problem is that if I use the command InsertImage, I get the default interface(or browser)  of CuteEditor and of course I would not like to have it. I would just like to have CuteEditor write the following HTML code: <img src="http://localhost/Carpenters/CarpentersAlbumPicturesLogo.asp?idCarp=2530">.

    How could I do this while keeping the possibility to the layout functions (width, height, border color…) ?

View Complete Thread