0

在我的网络应用程序中,我使用 FCKEditor 来编辑新闻。FCKEditor 使用 KCFinder 来浏览服务器的文件或图像。

在 config.php(FCKEditor->connector->browser)中,我配置了 UserFilesPath 和 UserFilesAbsolutePath。UserFilesPath 包含完整http://www.domain.tld/images/files/路径,而 UserFilesAbsolutePath 包含相同的路径,但使用文档根目录而不是 tld。

但是,当我转到 FCKEditor 窗口并尝试添加文本链接时,首先打开对话框,然后单击浏览器服务器,当我双击文件时,我返回对话框,路径如下/images/files/xyz.pdf:(例如)。

实际上我需要这样的路径:http://www.domain.tld/images/files/xyz.pdf

请查看场景并提供一些解决方案。

4

1 回答 1

0

StartupPath 是 CKFinder 对象的一个​​属性。有关更多信息,请参阅文档

CKFinder 包中包含一个工作示例,显示了如何使用 StartupPath:“_samples/js/popups.html”。

当使用 SetupFCKeditor 方法将 CKFinder 附加到 FCKeditor 时,可以以类似的方式使用 StartupPath。

在 javascript 中,您还可以使用以下语法:

CKFinder.SetupFCKeditor( oFCKeditor, { BasePath : '/ckfinder/', StartupPath :
 'Images:/path/to/directory/' } ) ;

因此,对于在 CKFinder 与 FCKeditor 集成时设置 StartupPath 的完整示例,只需按照以下步骤操作:

  • 打开_samples/js/fckeditor.html
  • 注释掉这一行(add double slash - "//"): //CKFinder.SetupFCKeditor( oFCKeditor, '../../' );
  • 在下面添加以下代码: CKFinder.SetupFCKeditor( oFCKeditor, { BasePath : '../../', StartupPath : 'Images:/directory/' } ) ; where"Images:/directory/"是有效的启动路径,它应该可以工作。
于 2014-10-09T12:00:16.487 回答