4

Hello i am trying to integrate the CKFinder with CKEditor in a laravel project. I have made following settings in my config.js file of CKEditor:

CKEDITOR.editorConfig = function( config ) {
    // Define changes to default configuration here. For example:
    // config.language = 'fr';
    config.uiColor = '#ffffff';
    config.removePlugins = 'forms, div, save, print, preview, newpage, _cut, bidi, showblocks, about, undo, redo, removeformat';


    config.filebrowserBrowseUrl = 'kcfinder/browse.php?opener=ckeditor&type=files';
    config.filebrowserImageBrowseUrl = 'kcfinder/browse.php?opener=ckeditor&type=images';
    config.filebrowserFlashBrowseUrl = 'kcfinder/browse.php?opener=ckeditor&type=flash';
    config.filebrowserUploadUrl = 'kcfinder/upload.php?opener=ckeditor&type=files';
    config.filebrowserImageUploadUrl = 'kcfinder/upload.php?opener=ckeditor&type=images';
    config.filebrowserFlashUploadUrl = 'kcfinder/upload.php?opener=ckeditor&type=flash';

};

Then i started to get Browse Server button as well. But i dont know why i am not able to access it. I guess i need to setup route to access it, correct?

Here i what error i am getting.

enter image description here

Any suggestions how i can setup the route for this?

Thank you!

user3201500
  • 1,538
  • 3
  • 22
  • 43
  • Is this the path to the file `public/pages/kcfinder/browse.php` relative to the project directory? Or is it `public/kcfinder/browse.php`? – Bogdan Feb 06 '16 at 13:30
  • it is public/kcfinder/browse.php – user3201500 Feb 08 '16 at 07:18
  • I have a route in between 'pages' – user3201500 Feb 08 '16 at 08:28
  • 1
    What do you mean you _"have a route in between pages'"_? If you have a route definition that you think is relevant to the question please edit and include it in your question. Either way, I belive you problem may stem from the way you include the file browser paths, more exactly that you define them as being relative to the current path. Instead you should make them relative to the root path by adding `/` at the beggining like this `/kcfinder/browse.php?opener=ckeditor&type=files` (of course add the slash `/` to all six lines to that include the `browse.php` or `upload.php` files). – Bogdan Feb 08 '16 at 10:46

2 Answers2

2

try this

CKEDITOR.replace( 'editor_ckf',    
{    
    filebrowserBrowseUrl: "{{ asset('ckfinder/ckfinder.html?Type=Files') }}",
    filebrowserImageBrowseUrl: "{{ asset('ckfinder/ckfinder.html?Type=Images') }}",
    filebrowserFlashBrowseUrl: "{{ asset('ckfinder/ckfinder.html?Type=Flash') }}",
    filebrowserUploadUrl: "{{ asset('ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files') }}",
    filebrowserImageUploadUrl: "{{ asset('ckfinder/core/connctor/php/connector.php?command=QuickUpload&type=Images') }}",
    filebrowserFlashUploadUrl: "{{ asset('ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash') }}"
});
BWA
  • 5,672
  • 7
  • 34
  • 45
mohamed al-ashry
  • 251
  • 6
  • 17
0

You're using a KCfinder configuration file with CKfinder. Make sure you're not mixing up both file managers.

Manu
  • 26
  • 3