最近做项目用到了fckeditor,但到配置上传路径的时候出了点问题,在网上找了找,也没有解决问题。最后自己看源码解决了。下面是一个完整的fckeditor.properties配置。
# 设置允许上传的文件类型
connector.resourceType.file.extensions.allowed = txt|rar|7z|zip
connector.resourceType.image.extensions.allowed = bmp|gif|jpeg|jpg|png
connector.resourceType.flash.extensions.allowed = swf|fla
connector.resourceType.media.extensions.allowed = mp3|wav
# 设置禁止上传的文件类型
#connector.resourceType.file.extensions.denied
#connector.resourceType.image.extensions.denied
#connector.resourceType.flash.extensions.denied
#connector.resourceType.media.extensions.denied
# 设置中类型文件的资源文件夹(上传的存放路径)
connector.resourceType.file.path = /file
connector.resourceType.image.path = /image
connector.resourceType.flash.path = /flash
connector.resourceType.media.path = /media
# Due to security issues with Apache modules, it is recommended to leave this
# setting enabled.
connector.forceSingleExtension = true
# 设置用户目录(有的说改这个属性就可以改上传目录)
connector.userFilesPath = /UserUpload
# 上传目录(如果更改上传目录的话,上面的一并要修改,保持一致)
connector.userFilesAbsolutePath = /UserUpload
# Instructs the Connector to check, if the uploaded image is really one
connector.secureImageUploads = true
# directory of the editor relative to the context root
fckeditor.basePath = /fckeditor
# height of the editor
fckeditor.height = 100%
# toolbar set of the editor
fckeditor.toolbarSet = Default
# width of the editor
fckeditor.width = 100%
# implementations
connector.impl = net.fckeditor.connector.impl.ContextConnector
#启用了一个东西,具体我也不知道是什么。
#有的上传不成功跟没有配置这个有关(默认为net.fckeditor.requestcycle.impl.DisabledUserAction)
connector.userActionImpl = net.fckeditor.requestcycle.impl.EnabledUserAction
connector.userPathBuilderImpl = net.fckeditor.requestcycle.impl.ContextPathBuilder
localization.localeResolverImpl = net.fckeditor.localization.impl.AcceptLanguageHeaderResolver
可以去fckeditor-java-core-2.6.jar,net.fckeditor.handlers包下找default.properties这个是默认的配置文件,可以参考去修改自己想要的。
connector.userFilesAbsolutePath这个属性可以更改上传路径。
connector.userFilesPath这个属性应该与
connector.userFilesAbsolutePath相同不然上传的资源会找不到(默认为userfiles)。
第一次写自己的技术笔记,希望同大家分享一下,如有问题请指正,请大家多多关照。
如果真的帮到你了的话,请评论回复一下。
分享到:
相关推荐
### Fckeditor2.6.4.1配置详解 #### 一、概述 FCKeditor(现更名为CKEditor)是一款强大的富文本编辑器,被广泛应用于Web应用中,以提供所见即所得(WYSIWYG)的编辑体验。本文将详细介绍Fckeditor2.6.4.1版本的...
4. 拷贝fckeditor.properties文件到Web项目的src源码根路径下,这个文件至少需要包含一条内容。 5. 在需要用到FCKeditor的JSP页面中添加标签引用。 6. 在HTML表单中使用FCKeditor标签。可以参考fckeditor-java-...
4、限制上传文件大小(这个也设置了可以自主修改,找到fckeditor.properties文件最后的地方,# maxFileSize 1M connector.resource.maxFileSize=1048576,单位是字节) 5、把里边没用的文件都删除了,呵呵 其中的...
在压缩包中的`fckeditor.js`文件可能包含了FCKeditor的核心逻辑,而`fckeditor.properties`文件则可能包含了一些配置参数,这些参数可能会影响到Media插件的行为和设置。 4. **与Java的结合**:尽管FCKeditor本身是...
FCKeditor是一款流行的开源在线文本编辑器,特别适合于网页开发者用于...你可以根据需求进一步定制FCKeditor,如调整样式、添加插件或修改上传路径等。FCKeditor提供了丰富的API和文档,帮助开发者实现更多高级功能。
- 如果项目使用Maven管理依赖,需要在pom.xml文件中添加以下依赖项,以确保正确运行FCKeditor和文件上传功能: ```xml <groupId>commons-fileupload <artifactId>commons-fileupload ${commons.fileupload....
- 在项目源代码的src目录下创建或修改**fckeditor.properties**文件,配置关键参数,例如设置`connector.userActionImpl`。 - 修改**fckconfig.js**文件,这是编辑器的主要配置文件,可以在这里设定工具栏功能、图片...