fck解决办法

2013-01-01 10:26

FCKeditor - XML request error: Not Found (404)

最近闲来无事,看了下FCKeditor 出现如标题的错误,特记录备忘!

第一步:新建一个项目:FCKEditorTest。

 

第二步:在工具栏中将FredCK.FCKeditorV2.dll,这个文件在FCKeditor.Net_2.5\bin\Release\2.0目录下,导入后就可以在工具栏上看到FCKEditor这一项了。

 

第三步:将FCKeditor_2.6目录下的fckeditor目录Copy到网站的根目录下。然后打开fckeditor目录下的fckconfig.js文件,找到以下的变量,将它们的值修改为aspx,如下:

 


var _FileBrowserLanguage      = 'aspx' ;  // asp | aspx | cfm | lasso | perl | php | py

var _QuickUploadLanguage     = 'aspx' ;  // asp | aspx | cfm | lasso | perl | php | py

 

第四步:找到fckeditor\editor\filemanager\connectors\aspx\config.ascx文件,将这个控件的CheckAuthentication()函数的返回值改为true,如下:

这一设置是为了允许在编辑器中上传图片


private bool CheckAuthentication()

         ...{

                   // WARNING : DO NOT simply return "true". By doing so, you are allowing

                   // "anyone" to upload and list the files in your server. You must implement

                   // some kind of session validation here. Even something very simple as...

                   //

                   //return ( Session[ "IsAuthorized" ] != null && (bool)Session[ "IsAuthorized" ] == true );

                   //

                   // ... where Session[ "IsAuthorized" ] is set to "true" as soon as the

                   // user logs in your system.

                   return true;

         }


 

 

第五步:建立一个保存图片的文件夹,用户上传的图片就保存在这个文件夹中,我在网站的根目录下建立名为UploadImages文件夹。

 

第六步:配置web.config,在它的appSettings节中加入

 

FCKEditor就可以使用了

// HTTP Error 404 - Not Found.这个错误的原因就是未使用此设置

<addkey="FCKeditor:BasePath"value="~/fckeditor/"/>

//XML Request Error, Internal Server Error (500)的原因是未使用此设置

<addkey="FCKeditor:UserFilesPath"value="~/fckeditor/ UploadImages /"/>

完成以上简单的设置后,

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值