带有自定义路径的CKFinder
如果您正在执行 URL 重写并且您希望 CKFinder 返回带有自定义路径的 URL,您可以执行以下操作:
您可以在 CKFinder 的 config.php 文件的 backends 部分中配置 CKFinder 如何将 URL 发送到 CKEditor:
$config['backends'][] = array(
'name' => 'default',
'adapter' => 'local',
'baseUrl' => 'http://base/url/ckfinder/will/give/to/ckeditor',
'root' => '/path/to/files/on/disk',
'chmodFiles' => 0777,
'chmodFolders' => 0755,
'filesystemEncoding' => 'UTF-8'
);
文件路径附加到所有 URL 中,此行为无法通过配置更改。
例如对于/path/to/files/on/disk/images/picture.png,返回的网址是http://base/url/ckfinder/will/give/to/ckeditor/images/picture.png
您也可以将'useProxyCommand' => true 添加到后端配置中。
这会将所有返回的 URL 更改为 http://localhost/core/connector/php/connector.php?command=Proxy&lang=en&type=Files&currentFolder=%2F&hash=9fd5e9f22b8dea6a&fileName=picture.png 的形式,其中 http://localhost/core/connector/php/connector.php 是用于发出请求以获取文件 URL 的 URL。
与文件管理器的自定义集成
如果您正在实现自己与文件管理器的集成,请检查您来自 /uploader/upload.php 的回复。 CKEditor 期望类似:
<script type='text/javascript'>window.parent.CKEDITOR.tools.callFunction(1, 'http://file/url', 'message');</script>`
您可以在CKEditor的documentation找到更多信息