How can i reference a file being inserted (outside the editor) just like when doing Insert Image outside the editor?

Last post 09-24-2007, 5:04 PM by sendittokeith. 3 replies.
Sort Posts: Previous Next
  •  09-24-2007, 8:52 AM 33782

    How can i reference a file being inserted (outside the editor) just like when doing Insert Image outside the editor?

    Hello,
     
    I have seen many code examples on Inserting an image outside the editor.  I have this working fine, but now i am trying to use the same concenpt when selecting a File using the Downloadable Files dialog.  Could someone PLEASE give me some insight on how to do this.
     
    ie: This works when selecting an image outside the editor (i can get the path the user selected) --- but this down work when using the Downloadable files.  Thank you very much in advance.
     
            function callInsertImage() 
            { 
              
                var ce_img; 
                ce_img = document.getElementById('<%= ce_image.ClientID%>');
                ce_img.focus(); 
                var ce_imgDoc = ce_img.GetDocument() 
                    
                ce_img.ExecCommand('ImageGalleryByBrowsing') 
                var ce_imgRange = ce_imgDoc.selection.createRange()             
                if (ce_imgDoc.selection.type == 'Control') 
                    { 
                        if (ce_imgRange.length == 1) 
                            { 
                                var ce_imgElement = ce_imgRange.item(0) 
                                if (ce_imgElement.tagName == 'IMG') 
                                    {  
                                        // THIS GUY RIGHT HERE GETS THE PATH TO THE IMAGE SELECTED, HOW DO I DO THIS FOR DOCUMENTS?
                                        document.getElementById('<%= txtImagePath.ClientID %>').value = ce_imgElement.src


                                     } 
                            } 
                    } 
                }
  •  09-24-2007, 9:56 AM 33784 in reply to 33782

    Re: How can i reference a file being inserted (outside the editor) just like when doing Insert Image outside the editor?

    Pleasee use the code of this example:
     
    asp.net file picker?

    How to use CuteEditor as a file picker?( Demo)

    This example demonstrates how to use CuteEditor as a file picker.

     
    The source code of this example can be found in the download package.
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  09-24-2007, 12:58 PM 33788 in reply to 33784

    Re: How can i reference a file being inserted (outside the editor) just like when doing Insert Image outside the editor?

    awesome, thanks adam i will give that a try.
  •  09-24-2007, 5:04 PM 33796 in reply to 33784

    Re: How can i reference a file being inserted (outside the editor) just like when doing Insert Image outside the editor?

    The sample works great.  Thanks again.
View as RSS news feed in XML