CKFinder baseDir 和 baseURL参数解释
来源:互联网 发布:淘宝美工岗位认识 编辑:程序博客网 时间:2024/06/11 13:58
版本 ckfinder 2.x
一、概念
参考官网解释(如果访问不了,可以点击最新的官方地址)
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 theuserfiles
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是上传文件目录在服务器中的绝对路径,baseURL是一个浏览器的访问路径(可以使用相对路径).
二、配置
baseDir跟baseURL其实都是指向同一个文件目录,但为什么配置了baseURL之后一般情况下也需要配置baseDir参数?这是因为服务器配置原因导致有可能根据baseURL找不到路径而出现故障,这个时候baseDir就能派上用场了,因为它是一个绝对路径,所以不受服务器配置的影响.
三、最佳实践
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 指向相同的地方,并且最好把文件上传的目录指向应用程序目录的外面.为什么呢?如果不这样做的话,每次升级系统重新发布war包都会覆盖原来的文件上传目录.有什么解决方法呢?可以设置虚拟目录或者符号连接(不推荐,每次发布都要新建符号连接)。如下配置
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
- CKFinder baseDir 和 baseURL参数解释
- ckeditor和ckfinder用法
- CKEditor和CKFinder
- tcpdump例子和参数解释
- Kafka 参数列表和解释
- CKFinder
- ckEditor 和 ckFinder 的使用
- ckeditor和ckfinder配合使用说明
- CKEditor和CKFinder的使用说明
- ckeditor和ckfinder的使用
- CKEditor和CKFinder的使用说明
- CKfinder和CKeditor使用笔记
- ckfinder.net完全讲解四(ckfinder销毁和关闭)
- Keybd_event 和mouse_event 参数之解释
- ToAWE和ToAWS两个参数的解释
- Flash OBJECT和EMBED标签参数解释
- Seoquake参数解释和如何使用
- fastcgi参数性能优化和解释
- 【MultiButton】并发状态事件驱动按键驱动模块
- 找到了几篇介绍c/c++多进程和多线程以及协程的文章,感觉很不错
- ActiveMQ学习总结——(四)Spring集成JMS连接AcitveMQ
- 深度学习: VGG 网络
- Ogre粒子编辑器ParticleUniverse
- CKFinder baseDir 和 baseURL参数解释
- oracle分页查询数据重复问题
- BlueZ 相关tools用法
- IO读取键盘录入
- 学习笔记:(2)Mysql基础-数据类型
- 三轴加速度传感器的计步测算法
- Nginx+php+http/https服务器配置
- EventBus的使用
- 面向对象编程 约瑟夫问题简要分析