Fckeditor 图片上传后只能看见到图片列表,无意中发现ckfinder 的样式真好看,而且能结合到一起!故写此文!
以下是Fckeditor + Ckfinder 的配置详情:
首先把下回来的ckfinder放到Fckeditor(就是你原来放Fck的目录下,ckfinder必须有FCK才可以用哦,她属于FCK的一庞大插件)的饿editor目录下,然后把ckfinder目录里的bin下的CKFinder.dll拷贝到网站目录bin下。然后开始设置配置:打开ckfinder目录下的config.ascx文件
修改地方有:
1、设置访问权限
public override 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 );
return true;//(增加这句,如果你需要设置打开ckfinder访问权限可以在这里设置哦,我这里就不考虑权限了直接打开。)
//
// ... where Session[ "IsAuthorized" ] is set to "true" as soon as the
// user logs on your system.
//return false;//(注释这句,默认这句未被注释)
}
2、设置文件访问目录
引用内容
BaseUrl = "/ckfinder/userfiles/";
这是上传文件的地址,也是ckfinder浏览文件的位置了。我们设置成
BaseUrl = "/fckeditor/editor/ckfinder/userfiles/";//这个路径可以自己设
3、设置生成缩略图
Thumbnails.Url = BaseUrl + "_thumbs/";
Thumbnails.Dir = "";
Thumbnails.Enabled = true;
Thumbnails.MaxWidth = 100;
Thumbnails.MaxHeight = 100;
Thumbnails.Quality = 80;
具体干啥应该看参数名称就知道了吧。。。
文件后面的代码是设置上传文件类型和大小等等,大家看参数应该都可以明白,这里略过。
4、修改原Fck配置文件以结合FCK和ckfinder。
打开/fckeditor/目录下的fckconfig.js,到最下面:
FCKConfig.LinkBrowser = true ;
FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'ckfinder/ckfinder.html' ;
FCKConfig.LinkBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; // 70%
FCKConfig.LinkBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; // 70%
FCKConfig.ImageBrowser = true ;
FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'ckfinder/ckfinder.html?type=Images' ;
FCKConfig.ImageBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; // 70% ;
FCKConfig.ImageBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; // 70% ;
FCKConfig.FlashBrowser = true ;
FCKConfig.FlashBrowserURL = FCKConfig.BasePath + 'ckfinder/ckfinder.html?type=Flash' ;
FCKConfig.FlashBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; //70% ;
FCKConfig.FlashBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; //70% ;
FCKConfig.LinkUpload = true ;
FCKConfig.LinkUploadURL = FCKConfig.BasePath +'ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files' ;
FCKConfig.LinkUploadAllowedExtensions = ".(7z|aiff|asf|avi|bmp|csv|doc|fla|flv|gif|gz|gzip|jpeg|jpg|mid|mov|mp3|mp4|mpc|mpeg|mpg|ods|odt|pdf|png|ppt|pxd|qt|ram|rar|rm|rmi|rmvb|rtf|sdc|sitd|swf|sxc|sxw|tar|tgz|tif|tiff|txt|vsd|wav|wma|wmv|xls|xml|zip)$" ; // empty for all
FCKConfig.LinkUploadDeniedExtensions = "" ; // empty for no one
FCKConfig.ImageUpload = true ;
FCKConfig.ImageUploadURL = FCKConfig.BasePath + 'ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images' ;
FCKConfig.ImageUploadAllowedExtensions = ".(jpg|gif|jpeg|png|bmp)$" ; // empty for all
FCKConfig.ImageUploadDeniedExtensions = "" ; // empty for no one
FCKConfig.FlashUpload = true ;
FCKConfig.FlashUploadURL = FCKConfig.BasePath + 'ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash' ;
FCKConfig.FlashUploadAllowedExtensions = ".(swf|flv)$" ; // empty for all
FCKConfig.FlashUploadDeniedExtensions = "" ; // empty for no one
红色部分是修改部分,权限问题可以根据自己的需要打开哦。
就这样了
Ckfinder是收费的于是在页面上出现了他们的一些版权信息清理掉:
ckfinder_ie.js 和 ckfinder_gecko.js 文件中分别注释掉:
/*en.call(window,qo);//注销版权 Modify By Mamm | 2009-9-4 16:20*/