doulang9521 2012-02-22 12:39
浏览 85

Ckeditor与CKfinder集成

I integrate Ck finder with Ck Editor but when I click the browse button, a window came in front me with a message:

"The file browser is disabled for security reasons. Please contact your system administrator and check the Ck Finder configuration file"

I don't know what to do

  • 写回答

2条回答 默认 最新

  • doumengxue7371 2013-05-27 20:14
    关注
    1. Download CKEditor and CKFinder.
    2. Put extracted code of both in one folder inside xampp as below.
    3. Create index file (index.html) which will be containing the editor as below code.

      <html>
      <head>
      <script type="text/javascript" src="ckeditor/ckeditor.js"></script>
      <script type="text/javascript" src="ckfinder/ckfinder.js"></script>
      </head>
      <body>
          <h1>CKEditor CKFinder Integration using PHP</h1>
          <textarea id="editor1" name="editor1" rows="10" cols="80"></textarea>
      <script type="text/javascript">
      var editor = CKEDITOR.replace( 'editor1', {
          filebrowserBrowseUrl : 'ckfinder/ckfinder.html',
          filebrowserImageBrowseUrl : 'ckfinder/ckfinder.html?type=Images',
          filebrowserFlashBrowseUrl : 'ckfinder/ckfinder.html?type=Flash',
          filebrowserUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
          filebrowserImageUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
          filebrowserFlashUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
      });
      CKFinder.setupCKEditor( editor, '../' );
      </script>
      </body>
      </html>
      

    so your folder structure will be something like this:

    htdocs
    |_integrated
        |_ckeditor
        |   |_config.js
        |   |_...
        |_ckfinder
        |   |_config.php
        |   |_...
        |_uploads
        |_index.html
    
    1. Now open file config.php inside ckfinder & make following changes:

      function CheckAuthentication() {
          // WARNING : DO NOT simply return "true". By doing so, you are allowing
          // "anyone" to upload and list the files in your server. You must implement
          // some kind of session validation here. Even something very simple as...
          // return isset($_SESSION['IsAuthorized']) && $_SESSION['IsAuthorized'];
          return true; // not good option though; go for sessions
      }
      $baseUrl = 'http://localhost/integrated/uploads/';
      $enabled = true;
      $config['SecureImageUploads'] = false;
      $config['ChmodFolders'] = 0777 ;
      
    2. Now open url http://localhost/integrated/ and try uploading image.
    评论

报告相同问题?

悬赏问题

  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 Revit2020下载问题
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大