CKEditor, Image Upload (filebrowserUploadUrl)

前端 未结 12 1472
误落风尘
误落风尘 2020-12-04 13:09

I\'m using CKEditor and would like to be able to allow users to upload and embed images in the Text Editor...

The following JS is what loads the CKEditor:

         


        
12条回答
  •  抹茶落季
    2020-12-04 14:02

    My latest issue was how to integrate CKFinder for image upload in CKEditor. Here the solution.

    1. Download CKEditor and extract in your web folder root.

    2. Download CKFinder and extract withing ckeditor folder.

    3. Then add references to the CKEditor, CKFinder and put

       
      

      to your aspx page.

    4. In code behind page OnLoad event add this code snippet

      protected override void OnLoad(EventArgs e)
      {
        CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
        _FileBrowser.BasePath = "ckeditor/ckfinder/";
        _FileBrowser.SetupCKEditor(CKEditorControl1);
      }
      
    5. Edit Confic.ascx file.

      public override bool CheckAuthentication()
      {
        return true;
      }
      
      // Perform additional checks for image files.
      SecureImageUploads = true;
      

    (source)

提交回复
热议问题