Question

I have the following integration CKEditor procedure:

window.onload = function(){
    var editor = CKEDITOR.replace( 'ckeditortextarea' );
    CKEDITOR.config.resize_enabled = false;
    CKFinder.setupCKEditor( editor, 'libraries/ckfinder/' );
};

I have my folders structured as such:

  • there is an WAMP alias named 'webx'.
  • CKEDITOR: webx/mysite/libraries/ckeditor/
  • CKFINDER: webx/mysite/libraries/ckfinder/
  • INDEX: webx/mysite/index.php

The integration procedure is within the 'head' tags. I have not changed any configuration files within the CK packages. The problem is that the integration is not successful, the upload/browse not being available in CKEditor.

My questions are:

  1. What am I doing wrong?
  2. What does basepath really represent?
Was it helpful?

Solution

The basepath should have been set '../ckfinder/' in order with my requirements. The browse/update sections appear now.

The basepath is referenced from within the ckfinder directory. So either http://domain/.../ckfinder/ or ../ckfinder are correct.

OTHER TIPS

Try following steps. I got it by this way.

1. Download CKEditor and CKFinder. Integrated code may be available on http://dwij.co.in/ckeditor-ckfinder-integration-using-php/
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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top