javascriptphpjqueryckeditorckfinder

How can i add domain url to the url of uploaded files when selected on ckfinder


I'm setting up ckfinder on CKEditor 4. When I select an image with "browse server" button, the URL of image is: /ckfinder/userfiles/images/image.png.

But it should be full URL like: http://example.com/ckfinder/userfiles/images/image.png.

enter image description here

My ckeditor/config.js file:

CKEDITOR.replace( 'content_en', {
    filebrowserBrowseUrl: 
    './assets/app/js/ckfinder/ckfinder.html',
filebrowserImageBrowseUrl: 
    './assets/app/js/ckfinder/ckfinder.html?type=Images',
filebrowserUploadUrl: 
    './assets/app/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
filebrowserImageUploadUrl: 
    './assets/app/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images'
});

My config.php file in ckfinder:

$config['backends'][] = array(
    'name'         => 'default',
    'adapter'      => 'local',
    'baseUrl'      => '/ckfinder/userfiles/',
//  'root'         => '', // Can be used to explicitly set the  CKFinder user files directory.
    'chmodFiles'   => 0777,
    'chmodFolders' => 0755,
    'filesystemEncoding' => 'UTF-8',
);

Solution

  • Please add full path in backend configuration for baseUrl property.

    Instead of:

    'baseUrl'      => '/ckfinder/userfiles/',
    

    Please use :

    'baseUrl'      => 'http://example.com//ckfinder/userfiles/',