1

我已经实现了最新版本的 CKeditor 并集成了 KCfinder(不是 CKfinder)。一切正常,但如果我选择图像或任何文件,KCfinder 会在 CKeditor 错误 url 的图像对话框中返回。

返回“/www/admin/files/upload/image.jpg”

我需要“/admin/files/upload/images.jpg”或“http://web.com/admin/files/upload/image.jpg”

CKeditor 配置文件:

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 配置文件

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

我可能已经尝试了所有选项,但没有任何效果......非常感谢您提供解决方案的提示。

4

1 回答 1

0

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.

于 2015-04-18T14:54:09.853 回答