您的位置:首页 > 其它

FckEditor上传图片问题解决方案

2010-06-12 11:59 369 查看
1、下载文件:FCKeditor 2.6.6, (之前先下了最新版,CKEditor 3.3.1,发现文件结构与之前版本大不一样,少了Editor文件夹,无法与原有项目结合)

地址: http://sourceforge.net/project/downloading.php?group_id=75348&filename=FCKeditor_2.6.6.zip

由于项目是ASP.net版本,所以还要下载:FCKeditor.Net 2.6.3

地址:https://sourceforge.net/projects/fckeditor/files/FCKeditor.Net/2.6.3/FCKeditor.Net_2.6.3.zip/download

2、解压FCKeditor 2.6.6,将 fckeditor 文件夹拷贝到项目根目录。

修改文件:\fckeditor\fckconfig.js

var _FileBrowserLanguage = 'aspx' ;

var _QuickUploadLanguage = 'aspx' ;

3、解压FCKeditor.Net 2.6.3,将 FCKeditor.Net_2.6.3\bin\Release\2.0 下的文件 FredCK.FCKeditorV2.dll 引用到项目的BIN目录。

然后将FCKeditor.Net_2.6.3\_samples\aspx目录的文件,拷贝到 fckeditor\_samples 文件夹下。其中包括sample01.aspx ~ sample04.aspx四个测试文件。

任选一个文件,这里

我选sample02.aspx,提示出错:“当前上下文中不存在名称…………”。不知道是否是VS2005的BUG,直接拷贝进项目的文件无法识别。因此直接新建一个页面,然后拷贝

sample02.aspx的内容,再测试。(先把sample01.aspx ~ sample04.aspx从项目中排除,否则可能始终无法编译通过。)

4、上传图片过程中,出现问题:停留在进度窗口,无响应。

打开:\fckeditor\editor\filemanager\connectors\aspx\config.ascx

修改代码:

/**
* This function must check the user session to be sure that he/she is
* authorized to upload and access files in the File Browser.
*/
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 false; //这里改为true即可。 WARNING :不建议直接改为TRUE,需要在项目加上用户权限验证。
}

5、调试成功!!!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: