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

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

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

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

请教各位用过的朋友

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

还是我的设置有问题?

另:如果我想在上传时自动创建的话 ,该如何处理,小弟才疏学浅,望各位高人指点一二。
...全文
721 12 打赏 收藏 转发到动态 举报
AI 作业
写回复
用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 文件夹中没有缩略图

62,243

社区成员

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

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

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

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