2014-10-09 258 views
0

在我的Web應用程序中,我使用FCKEditor編輯新聞。 FCKEditor使用KCFinder瀏覽服務器上的文件或圖像。帶KCFinder的FCKEditor UserFilesPath

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

但是,當我去FCKEditor窗口,並嘗試添加一個鏈接到文本,首先對話框打開,比我點擊瀏覽器服務器,當我雙擊文件,我回到對話框的路徑像這樣:/images/files/xyz.pdf(eg)。

其實我需要這樣的路徑:http://www.domain.tld/images/files/xyz.pdf

請檢查方案,並提供了一些解決方案。

回答

0

StartupPath是CKFinder對象的屬性。有關更多信息,請參見documentation

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/' }) ; 其中"Images:/directory/"是一個有效的啓動路徑,它應該工作。
+0

感謝您的快速回復......但是您錯過了,我寫了KCFinder而不是CKFinder ......您知道KCFinder嗎? – 2014-10-09 12:02:10

+0

特赦隊友。你想'FCKEditor'與'KCFinder'集成嗎?我也有一些關於'KCFinder'的知識。 – 2014-10-09 12:04:18

+0

您是否將權限設置爲「0777」? – 2014-10-09 12:07:21