08-05
08

.FCKeditor编辑器文件上传配置

<!--嵌入FCK编辑器-->
<%
         FCKeditor oFCKeditor ;
         oFCKeditor = new FCKeditor( request, "content" ) ;
         oFCKeditor.setBasePath("") ;
         oFCKeditor.setValue(news.getContent());
         out.println( oFCKeditor.create() ) ;
%>

FCKeditor编辑器的配置文件是fckconfig.js,其中有对编辑器各种默认属性的设置。以下是fckeditor与java集成使用时上传文件的设置(需要注意的是编辑器不会自动创建文件上传的文件夹,需要在项目的根目录中手动添加),将fckeditor.js文件中以下几个属性原来的值修改为如下设置:

FCKConfig.LinkBrowserURL = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Connector=connectors/jsp/connector" ;
FCKConfig.ImageBrowserURL = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector" ;
FCKConfig.FlashBrowserURL =FCKConfig.BasePath + "filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/jsp/connector" ;

FCKConfig.LinkUploadURL = FCKConfig.BasePath + 'filemanager/upload/simpleuploader?Type=File' ;
FCKConfig.ImageUploadURL = FCKConfig.BasePath + 'filemanager/upload/simpleuploader?Type=Image' ;
FCKConfig.FlashUploadURL = FCKConfig.BasePath + 'filemanager/upload/simpleuploader?Type=Flash' ;


至此,即可使用FCKeditor的文件上传功能。


文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags: 上传 配置
相关日志:
评论: 0 | 引用: 0 | 查看次数: 649
发表评论
昵 称:
密 码: 游客发言不需要密码.
内 容:
验证码: 验证码
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 1000 字 | UBB代码 开启 | [img]标签 关闭