Mark
Mark

Reputation: 11

CKeditor with KCfinder - finder returns wrong url of selected image

I have implemented latest version of CKeditor and integrated KCfinder (not CKfinder). All works fine, but if I select image or any file, KCfinder returns in image dialog of CKeditor wrong url.

returns "/www/admin/files/upload/image.jpg"

I need "/admin/files/upload/images.jpg" or "http:// web.com/admin/files/upload/image.jpg"

CKeditor config file:

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

KCfinder config file

'uploadURL' => "../upload/",
'uploadDir' => "",

I have tried perhaps all options, but with no effect...thanks a lot for tips to solution.

Upvotes: 1

Views: 1759

Answers (1)

user3706926
user3706926

Reputation: 181

I think the main problem is about the directory you selected. This is what I did when determining the real path :

For example you put ckeditor file in directory :

root/plugins/ckeditor/(ck editor files),

and kcfinder in

root/plugins/ckeditor/kcfinder/(kcfinder all file).

Then you should start your path from root which represented by ../. (root is equal to ../)

config.filebrowserBrowseUrl = '../plugins/ckeditor/kcfinder/browse.php?opener=ckeditor&type=files'; ans so on.

in your case, if admin directory located in root or parent directory, then your script would be ;

config.filebrowserBrowseUrl = '../admin/files/kcfinder/browse.php?opener=ckeditor&type=files';

Note :

/files/upload - relative to the site root

../upload - 'upload' directory located in KCFinder parent directory

httр://yourdomain.com/upload - absolute URL path.

I hope this will help.

Upvotes: 0

Related Questions