日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

CKFinder baseDir 和 baseURL参数解释

發(fā)布時間:2023/12/20 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 CKFinder baseDir 和 baseURL参数解释 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

版本 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:

<baseDir>C:/myimages</baseDir>

<Context antiJARLocking="true" path="/CKFinderJava" reloadable="true" ><Resources><PreResources base="C://myimages" className="org.apache.catalina.webresources.DirResourceSet" webAppMount="/userfiles" /></Resources><Valve className="org.apache.catalina.valves.RemoteAddrValve" allow=".*" /> </Context>

參考資料:

1.baseDir and baseURL Parameters Explained
2.ckeditor

總結(jié)

以上是生活随笔為你收集整理的CKFinder baseDir 和 baseURL参数解释的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。