Web工程目錄demo,解壓FCKeditor_2.2.zip,保存在demo/FCKeditor下。用戶上傳文件目錄demo/UserFiles。 1,設置 editor.LinkBrowserURL = Request.ApplicationPath + "/FCKeditor/editor/filemanager/browser/default/browser.html?Connector=connectors/aspx/connector.aspx"; editor.ImageBrowserURL = Request.ApplicationPath + "/FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/aspx/connector.aspx"; 2,解壓FCKeditor.Net_2.2.zip,修改其中的文件重新生成dll文件 2.1修改FCKeditor.cs中的basepath屬性
[ DefaultValue( "~/FCKeditor/" ) ]
public string BasePath
{
get
 {
object o = ViewState["BasePath"] ;

if ( o == null )
o = System.Configuration.ConfigurationManager.AppSettings["FCKeditor:BasePath"] ;

return ( o == null ? "~/FCKeditor/" : (string)o ) ;
}
 set { ViewState["BasePath"] = value ; }
}

2.2修改FileWorkerBase.cs增加成員變量private const string DEFAULT_USER_FILES_DIR = "/UserFiles/"; 增加屬性
protected string UserFilesDirectoryForUpload
{
get
 {
return Server.MapPath(DEFAULT_USER_FILES_DIR);
}

}
在UserFilesPath屬性中增加return Request.ApplicationPath + DEFAULT_USER_FILES_DIR; 2.3修改Uploader.cs將string sFilePath = System.IO.Path.Combine(this.UserFilesDirectory, sFileName);改為string sFilePath = System.IO.Path.Combine(this.UserFilesDirectoryForUpload, sFileName); 3,解決FCKEditor上傳時中文文件名的方法 主要是修改文件frmUpload.html文件.修改方法是:先把frmUpload.html文件重新命名,然后添加一個aspx頁面文件,把上面的內容復制到aspx頁面文件中,最后把新添加的aspx文件后綴改為html即可.修改后的文件內容如下: <%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
|