FCKeditor 错误总结

来源:互联网 发布:淘宝复制链接发给好友 编辑:程序博客网 时间:2024/06/16 12:22

 

1.FCKeditor出现"this connector is disabled Please check the"editor/filemanager/connectors/aspx/config.aspx"错误的解决办法

错误信息

 

我最近在整合FCK,我也遇到了这个问题

 

打开editor/filemanager/connectors/aspx/config.ascx修改CheckAuthentication()方法,返回true

C# code

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;
}

随便看了一下config.ascx里的内容,发现如果想让对每个用户进行不同的配置,FCKeditor支持的更好了。

 

设置这个功能就是为了解决上传漏洞,在那个地方写一个判断用户身份的代码好了!如果判断得到就返回TRUE,这样安全性会好一些!

 

在登录时加入
Session[ "IsAuthorized" ] = true;
去掉
// return ( Session[ "IsAuthorized" ] != null && (bool)Session[ "IsAuthorized" ] == true );
前的注释。不然任何人都可以上传文件。

 

2,如果报错XML request error: Internal Server Error(500)

 

很可能就是目录路径不对和写权限没有。


 

使用”插入图像”、“插入flash”中的浏览上传和直接上传,都正常。但是使用“插入超链接”时,发现使用浏览上传正常,但是使用直接上传,就提示:Invalid request,百思不得其解,网上查了半天,也没人遇到过。后然偶然在浏览fckconfig.js文件时,发现了问题。
fckconfig.js中,比较linkupload和imageuplink后,发现:

 

 

 

 

在ImageUpload最后,有Type=Image参数,而LinkUpload中却没有,先尝试加上Type=Link,失败,再尝试加上Type=File后,成功了。所以问题出在少了参数“Type=File”。

 

原创粉丝点击