CKFinder baseDir 和 baseURL参数解释
版本 ckfinder 2.x
一、概念
參考官網(wǎng)解釋(如果訪問不了,可以點擊最新的官方地址)
Both baseDir and baseURL should point to the same location on the
server — the userfiles directory that contains all user files uploaded
with CKFinder. The difference between them is as follows:
- baseURL gives a full URL to the userfiles directory or a path that is relative to the domain. For example: <baseURL>http://example.com/CKFinderJava/userfiles/</baseURL><baseURL>/CKFinderJava/userfiles/</baseURL>
- baseDir gives an absolute path to the directory on the server (a physical machine). For example: <baseDir>/usr/tomcat/webapps/CKFinderJava/userfiles/</baseDir><baseDir>C:\tomcat\webapps\CKFinderJava\userfiles\</baseDir>
也就是說,baseDir是上傳文件目錄在服務(wù)器中的絕對路徑,baseURL是一個瀏覽器的訪問路徑(可以使用相對路徑).
二、配置
baseDir跟baseURL其實都是指向同一個文件目錄,但為什么配置了baseURL之后一般情況下也需要配置baseDir參數(shù)?這是因為服務(wù)器配置原因?qū)е掠锌赡芨鶕?jù)baseURL找不到路徑而出現(xiàn)故障,這個時候baseDir就能派上用場了,因為它是一個絕對路徑,所以不受服務(wù)器配置的影響.
三、最佳實踐
1.it is always recommended to set both baseUrl and baseDir so that they point to same location which is outside of an application
directory.
2.First of all you should set both properties so that they point to same location which is accessible through HTTP and from the file
system. Second, you should set these properties to point to location
outside of CKFinder application folder.
baseUrl 、baseDir 指向相同的地方,并且最好把文件上傳的目錄指向應(yīng)用程序目錄的外面.為什么呢?如果不這樣做的話,每次升級系統(tǒng)重新發(fā)布war包都會覆蓋原來的文件上傳目錄.有什么解決方法呢?可以設(shè)置虛擬目錄或者符號連接(不推薦,每次發(fā)布都要新建符號連接)。如下配置
tomcat 6
在 server.xml文件中增加一個context .
tomcat 7-8
CKFinder config.xml settings:
參考資料:
1.baseDir and baseURL Parameters Explained
2.ckeditor
總結(jié)
以上是生活随笔為你收集整理的CKFinder baseDir 和 baseURL参数解释的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 五分钟带你玩转docker(三)全网最新
- 下一篇: 谷歌浏览器java不能启动_seleni