ckfinder 上传图片后是否会自动生成缩略图

singlexinglove 2010-09-11 08:58:37
如题
我用的是ckeditor 和 ckfinder 编辑器

在上传图片时 从本地上传成功后,发现其并未创建缩略图,

而通过浏览服务器按钮,则可以创建其对应的缩略图

请教各位用过的朋友

是否ckfinder 在本地上传图片时 并未自动创建缩略图(注:我已将缩略图产生的配置设置为true)

还是我的设置有问题?

另:如果我想在上传时自动创建的话 ,该如何处理,小弟才疏学浅,望各位高人指点一二。
...全文
716 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
pingxingguaiguai 2010-09-11
  • 打赏
  • 举报
回复
学习一下~~~
singlexinglove 2010-09-11
  • 打赏
  • 举报
回复
貌似还是不行
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 );
//
// ... where Session[ "IsAuthorized" ] is set to "true" as soon as the
// user logs on your system.

return true;
}

/**
* All configuration settings must be defined here.
*/
public override void SetConfig()
{
// Paste your license name and key here. If left blank, CKFinder will
// be fully functional, in Demo Mode.
LicenseName = "";
LicenseKey = "";

// The base URL used to reach files in CKFinder through the browser.
BaseUrl = "~/ckfinder/userfiles/";

// The phisical directory in the server where the file will end up. If
// blank, CKFinder attempts to resolve BaseUrl.
BaseDir = "";
// Optional: enable extra plugins (remember to copy .dll files first).
Plugins = new string[] {
// "CKFinder.Plugins.FileEditor, CKFinder_FileEditor",
// "CKFinder.Plugins.ImageResize, CKFinder_ImageResize"
};
// Settings for extra plugins.
PluginSettings = new Hashtable();
PluginSettings.Add("ImageResize_smallThumb", "90x90" );
PluginSettings.Add("ImageResize_mediumThumb", "120x120" );
PluginSettings.Add("ImageResize_largeThumb", "180x180" );

// Thumbnail settings.
// "Url" is used to reach the thumbnails with the browser, while "Dir"
// points to the physical location of the thumbnail files in the server.
Thumbnails.Url = BaseUrl + "_thumbs/";
if (BaseDir != "")
{
Thumbnails.Dir = BaseDir + "_thumbs/";
}

Thumbnails.Enabled = true;
Thumbnails.DirectAccess = false;
Thumbnails.MaxWidth = 100;
Thumbnails.MaxHeight = 100;
Thumbnails.Quality = 80;
wuyq11 2010-09-11
  • 打赏
  • 举报
回复
BaseDir = "";
Thumbnails.Dir = "";
porschev 2010-09-11
  • 打赏
  • 举报
回复
5.上传后缩略图无法正常显示
这是ckFinder在windows系统中的一个小bug,定位到Settings\Thumbnails.cs,找到public string GetTargetDirectory()方法,改成下面这样:

01 if (Dir.Length == 0 || Dir.Substring(0,1)!="/") //如果Dir为空,或者只是相对路径
02 {
03 return HttpContext.Current.Server.MapPath(Url);
04 }
05 else
06 {
07 if (Dir.IndexOf(":\\") == -1)//如果不是物理路径
08 {
09 return HttpContext.Current.Server.MapPath(Dir);
10 }
11 else
12 {
13 return Dir;
14 }
15 }
infim 2010-09-11
  • 打赏
  • 举报
回复
默认情况先是缩略图,不过可以修改。
singlexinglove 2010-09-11
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 jinkuang45 的回复:]
我记得上传完自动转到预览里 然后点插入 在能插入来这!!!
[/Quote]

不太明白
冰川711 2010-09-11
  • 打赏
  • 举报
回复
我记得上传完自动转到预览里 然后点插入 在能插入来这!!!
singlexinglove 2010-09-11
  • 打赏
  • 举报
回复
[Quote=引用 11 楼 hefuming5 的回复:]
http://topic.csdn.net/u/20100309/11/08464F98-9469-4885-A040-E442528DCE7C.html
[/Quote]

我试过了 还是不好用 不知各位是否测试过 我用的时候 每上传一个后 thumbs 文件夹中没有缩略图
.net环境下ckeditor与ckfinder学习笔记 ckeditor 3.0.1学习笔记 一.ckeditor 3.0.1精简 精简前:4.52M 精简后:853K 1.删除_samples和_source文件夹,分别为示例文件和未压缩源程序 2.删除lang文件夹下除zh-cn.js,en.js下的所有语言文件.根据需要删除 3.删除根目录下的changes.html(更新列表),install.html(安装指向),license.html(使用许可). 4.删除skins目录下不需要的皮肤.我一般用V2(简单.朴素) //如果只保留V2则必须在config.js中指定皮肤 二.ckeditor 3.0.1相关文件配置路径 1./ckeditor.js 核心文件,调用需加载 2./config.js 配置文件,参数配置均在此完成 3./plugins/smiley/images 表情符号. 三.ckeditor应用(.net环境) 1.引用js脚本 <script type="text/javascript" src="ckeditor/ckeditor.js"> <script type="text/javascript">CKEDITOR.replace('TextBox1')ckeditor配置(config.js配置文件) 详细api参数见:http://docs.cksource.com/ckeditor_api/,我的默认配置 CKEDITOR.editorConfig = function(config) { config.language = "zh-cn"; config.skin = "v2"; config.width = "80%"; config.height = "400px"; config.resize_enabled = false; config.toolbar = [ ['Source', 'Preview', '-'], ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', ], ['Undo', 'Redo', '-', 'Find', 'Replace', '-', 'SelectAll', 'RemoveFormat'], ['Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak'], '/', ['Bold', 'Italic', 'Underline', '-', 'Subscript', 'Superscript'], ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'], ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], ['Link', 'Unlink', 'Anchor'], '/', ['Format', 'Font', 'FontSize'], ['TextColor', 'BGColor'], ['Maximize', 'ShowBlocks', '-', 'About'] ]; ckfinder学习笔记 一.ckfinder精简 精简前:1.10M 精简后:947K 1.删除_samples和_source文件夹,分别为示例文件和未压缩源程序 2.删除根目录下changelog.txt,install.txt,license.txt文件 3.删除core/lang目录下除en.js,zh-cn.js的所有语言文件(根据条件删除) 二.ckfinder配置 1.复制/bin目录下的ckfinder.dll文件至站点bin目录 2.复制ckfinder目录至站点根目录下(可另选择路径) 三.ckfinder应用 1.与ckeditor集成,详情见官方文档,官方文档是加载修改,我用的方法是全局修改. 具体操作方法如下:修改ckeditor目录下的config.js文件,添加: config.filebrowserBrowseUrl = '/ckfinder/ckfinder.html'; config.filebrowserImageBrowseUrl = '/ckfinder/ckfinder.html?Type=Images'; config.filebrowserFlashBrowseUrl = '/ckfinder/ckfinder.html?Type=Flash'; config.filebrowserUploadUrl = '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files'; config.filebrowserImageUploadUrl = '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images'; config.filebrowserFlashUploadUrl = '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash'; config.filebrowserWindowWidth = '800'; config.filebrowserWindowHeight = '500'; 以上URL值需要根据你ckfinder路径的不同而不同, 2.单独应用 3.破解: 打开core/js下的两个ckfinder_ie.js和ckfinder_gecko.js文件.查找字符串"en.call(window,qo);"将其注释即可 ----------------------------------------------- 上传路径地址修改 1. 打开 " \ckfinder\config.ascx ",为SetConfig方法中的 BaseUrl 指定默认路径,如: // 以userfiles 为默认路径,其目录下自动生成images、flash等子目录。 BaseUrl = " ~/ckfinder/userfiles/"; // NOTE:注意“ ~/ ”。 详细出处参考:http://www.jb51.net/article/21907.htm 2、设置生成缩略图 引用内容 Thumbnails.Url = BaseUrl + "_thumbs/"; Thumbnails.Dir = ""; Thumbnails.Enabled = true; Thumbnails.MaxWidth = 100; Thumbnails.MaxHeight = 100; Thumbnails.Quality = 80;

62,047

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧