System.IO.Directory.CreateDirectory中的缩略图创建失败

时间:2015-04-09 02:11:59

标签: ckfinder

当我点击“浏览服务器”时,首次加载页面时会显示所有图像的缩略图。第二页加载显示某些图像的缩略图或根本没有缩略图。第三次和后续页面加载显示无缩略图。

如果我直接加载缩略图src URL,我会收到以下堆栈跟踪。

/ckfinder/core/connector/aspx/connector.aspx?command=Thumbnail&type=Images&currentFolder=%2F&langCode=en&hash=f39457780249dcf6&FileName=EDE-AD-vt(1).PNG&安培; fileHash = 201210090617-94

    [SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
       System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
       System.Security.CodeAccessPermission.Demand() +58
       System.IO.Directory.InternalCreateDirectory(String fullPath, String path, DirectorySecurity dirSecurity) +595
       System.IO.Directory.CreateDirectory(String path, DirectorySecurity directorySecurity) +150
       CKFinder.Connector.FolderHandler.get_ThumbsServerPath() +136
       CKFinder.Connector.CommandHandlers.ThumbnailCommandHandler.SendResponse(HttpResponse response) +473
       CKFinder.Connector.Connector.OnLoad(EventArgs e) +974
       System.Web.UI.Control.LoadRecursive() +50
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785
       System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242
       System.Web.UI.Page.ProcessRequest() +80
       System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
       System.Web.UI.Page.ProcessRequest(HttpContext context) +49
       ASP.admin_ckfinder_core_connector_aspx_connector_aspx.ProcessRequest(HttpContext context) in App_Web_connector.aspx.b2500d1b.24hqjdsn.0.cs:0
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

我无法更改权限,因为此网站位于共享主机上。我的问题有两方面:

  1. 为什么创建缩略图需要创建目录?
  2. 我可以禁用此行为吗?或者我可以完全禁用缩略图缓存(并在请求时始终创建缩略图)。

1 个答案:

答案 0 :(得分:0)

回答你的两个问题:
CKFinder在/ userfiles / _thumbs文件夹中重新创建文件夹结构,以便在那里缓存缩略图。如果动态创建缩略图,则当流量较大和/或图像数量较大时,这会导致服务器死机。

我在CKFinder中唯一可用的解决方案,在这种特殊情况下,我没有使用缩略图(在config.ascx中设置以下选项):

Thumbnails.Enabled = false;