关于fck2.6下传图片一直报203异常的原因

关于fck2.6上传图片一直报203错误的原因
继上次解决fck2.6一直报203错误之后,最近调试fck2.6的源码终于知道了为什么一直报那个错误,项目最初上线时我的那个上传图片的途径是在fckeditor.properties中配置的,路径配置如下:
      connector.userFilesPath=/upload/blog
     connector.userFilesAbsolutePath=/upload/blog
前边说过了刚开始是可以上传图片的,后来就不行,报203错误,解决掉203错误后,我发现每次上传图片的路径变了,变成了fck自己默认的路径,即“/userfiles/image/1.jpg”,而且每次启动tomact的时候,控制台都会输出一句话
“63 [main] INFO net.fckeditor.handlers.PropertiesLoader - /fckeditor.properties not found”
说我配置的属性文件没有找到,上网搜了一下,不知道看了谁的文章无意中发现fck还有一个自己默认的属性配置文件叫“default.properties”,它在fckeditor-java-core-2.6.jar包中,我把这个jar包拷出来解压开它位于net.fckeditor.handlers包下,里边的代码为:


# default allowed extensions settings
connector.resourceType.file.extensions.allowed = 7z|aiff|asf|avi|bmp|csv|doc|fla|flv|gif|gz|gzip|jpeg|jpg|mid|mov|mp3|mp4|mpc|mpeg|mpg|ods|odt|pdf|png|ppt|pxd|qt|ram|rar|rm|rmi|rmvb|rtf|sdc|sitd|swf|sxc|sxw|tar|tgz|tif|tiff|txt|vsd|wav|wma|wmv|xls|xml|zip
connector.resourceType.image.extensions.allowed = bmp|gif|jpeg|jpg|png
connector.resourceType.flash.extensions.allowed = swf|fla
connector.resourceType.media.extensions.allowed = aiff|asf|avi|bmp|fla|flv|gif|jpeg|jpg|mid|mov|mp3|mp4|mpc|mpeg|mpg|png|qt|ram|rm|rmi|rmvb|swf|tif|tiff|wav|wma|wmv

# default resource type paths
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

# base URL path for the userfiles
connector.userFilesPath = /userfiles
# base system path on the backend for the userfiles
connector.userFilesAbsolutePath = /userfiles
# 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

# default height of the editor
fckeditor.height = 200

# default toolbar set of the editor
fckeditor.toolbarSet = Default

# default width of the editor
fckeditor.width = 100%

# default implementations
connector.impl = net.fckeditor.connector.impl.ContextConnector
connector.userActionImpl = net.fckeditor.requestcycle.impl.DisabledUserAction
connector.userPathBuilderImpl = net.fckeditor.requestcycle.impl.ContextPathBuilder
localization.localeResolverImpl = net.fckeditor.localization.impl.AcceptLanguageHeaderResolver

(红色的是重点)看了之后恍然大悟,难怪之前图片一直上传不上去报权限错误,控制台也一直输出说fck.properties找不到,原来程序走的是这个jar包中默认的配置文件,然后我就把配置文件改掉了,改成我自己需要的,即:
connector.resourceType.image.path = /image
connector.userFilesPath = /upload/blog
connector.userFilesAbsolutePath = /upload/blog
connector.userActionImpl = net.fckeditor.requestcycle.impl.EnabledUserAction
结果就好了,改动之后把原来那个jar中的default.properties替换成改动后的就可以了不过我还不知道程序为什么找不到那个配置文件,正在发现中,O(∩_∩)O~
1 楼 阳光泛滥的日子 2012-02-17  
问题解决! 你的“无意中发现”很给力
2 楼 xiayujiejob36 2012-03-21  
阳光泛滥的日子 写道
问题解决! 你的“无意中发现”很给力

O(∩_∩)O哈哈~,去年的事了,那个时候快被这个东西搞翻了,现在才发现把这个博文写出来很给用,(*^__^*) 嘻嘻……,至少能帮到人。