CKFinder baseDir 和 baseURL参数解释
版本 ckfinder 2.x
一、概念
參考官網(wǎng)解釋(如果訪問(wèn)不了,可以點(diǎn)擊最新的官方地址)
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>
也就是說(shuō),baseDir是上傳文件目錄在服務(wù)器中的絕對(duì)路徑,baseURL是一個(gè)瀏覽器的訪問(wèn)路徑(可以使用相對(duì)路徑).
二、配置
baseDir跟baseURL其實(shí)都是指向同一個(gè)文件目錄,但為什么配置了baseURL之后一般情況下也需要配置baseDir參數(shù)?這是因?yàn)榉?wù)器配置原因?qū)е掠锌赡芨鶕?jù)baseURL找不到路徑而出現(xiàn)故障,這個(gè)時(shí)候baseDir就能派上用場(chǎng)了,因?yàn)樗且粋€(gè)絕對(duì)路徑,所以不受服務(wù)器配置的影響.
三、最佳實(shí)踐
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)用程序目錄的外面.為什么呢?如果不這樣做的話(huà),每次升級(jí)系統(tǒng)重新發(fā)布war包都會(huì)覆蓋原來(lái)的文件上傳目錄.有什么解決方法呢?可以設(shè)置虛擬目錄或者符號(hào)連接(不推薦,每次發(fā)布都要新建符號(hào)連接)。如下配置
tomcat 6
在 server.xml文件中增加一個(gè)context .
tomcat 7-8
CKFinder config.xml settings:
參考資料:
1.baseDir and baseURL Parameters Explained
2.ckeditor
總結(jié)
以上是生活随笔為你收集整理的CKFinder baseDir 和 baseURL参数解释的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 五分钟带你玩转docker(三)全网最新
- 下一篇: 网盘嵌入分类信息 商业版/免费下载