急急急急!!!!!最近在用FCKeditor+Ckfinder,出现了几个问题,望大虾们帮忙解决!!!!!!

华丽丽的小低调 华丽丽的小低调 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
碰到的第一个比较棘手的问题:我FCKeditor+Ckfinder都配置好了,已经可以用了,但是发现上传图片后,图片默认保存在C:\Inetpub\wwwroot\ckfinder\userfiles 目录下,因为要做很多网站所以不可能所有用户的文件都放在一起,而我希望他们上传的文件都保存在他们自己的站点目录下,我看了N多帖子,最后还是设置了绝对路径。有没有办法设相对路径让上传的文件都保存在他们自己的站点目录下?
我用的是ckfinder_aspnet_2.0.2.1
其中config.ascx代码已经修改如下:

<%@ Control Language="C#" EnableViewState="false" AutoEventWireup="false" Inherits="CKFinder.Settings.ConfigFile" %>
<%@ Import Namespace="CKFinder.Settings" %>
<script runat="server">

/**
* This function must check the user session to be sure that he/she is
* authorized to upload and access files using CKFinder.
*/
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/";
BaseUrl = "ckfinder/userfiles/";



// The phisical directory in the server where the file will end up. If
// blank, CKFinder attempts to resolve BaseUrl.
//BaseDir = Server.MapPath(BaseUrl) + "/";
BaseDir = "D:/_Samples/ckfinder/userfiles/";
//BaseDir = "";


// Optional: enable extra plugins (remember to copy .dll files first).
Plugins = new string[] {
// "CKFinder.Plugins.FileEditor, CKFinder_FileEditor",
// "CKFinder.Plugins.ImageResize, CKFinder_ImageResize",
// "CKFinder.Plugins.Watermark, CKFinder_Watermark"
};
// Settings for extra plugins.
PluginSettings = new Hashtable();
PluginSettings.Add("ImageResize_smallThumb", "90x90" );
PluginSettings.Add("ImageResize_mediumThumb", "120x120" );
PluginSettings.Add("ImageResize_largeThumb", "180x180" );
// Name of the watermark image in plugins/watermark folder
PluginSettings.Add("Watermark_source", "logo.gif" );
PluginSettings.Add("Watermark_marginRight", "5" );
PluginSettings.Add("Watermark_marginBottom", "5" );
PluginSettings.Add("Watermark_quality", "90" );
PluginSettings.Add("Watermark_transparency", "80" );

// 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/";
//Thumbnails.Dir = "";

if ( BaseDir != "" ) {
Thumbnails.Dir = BaseDir + "_thumbs/";
//Thumbnails.Dir ="";
}

Thumbnails.Enabled = true;
Thumbnails.DirectAccess = false;
Thumbnails.MaxWidth = 100;
Thumbnails.MaxHeight = 100;
Thumbnails.Quality = 80;

// Set the maximum size of uploaded images. If an uploaded image is
// larger, it gets scaled down proportionally. Set to 0 to disable this
// feature.
Images.MaxWidth = 1600;
Images.MaxHeight = 1200;
Images.Quality = 80;

// Indicates that the file size (MaxSize) for images must be checked only
// after scaling them. Otherwise, it is checked right after uploading.
CheckSizeAfterScaling = true;

// Due to security issues with Apache modules, it is recommended to leave the
// following setting enabled. It can be safely disabled on IIS.
ForceSingleExtension = true;

// For security, HTML is allowed in the first Kb of data for files having the
// following extensions only.
HtmlExtensions = new string[] { "html", "htm", "xml", "js" };

// Folders to not display in CKFinder, no matter their location. No
// paths are accepted, only the folder name.
// The * and ? wildcards are accepted.
HideFolders = new string[] { ".svn", "CVS" };

// Files to not display in CKFinder, no matter their location. No
// paths are accepted, only the file name, including extension.
// The * and ? wildcards are accepted.
HideFiles = new string[] { ".*" };

// Perform additional checks for image files.
SecureImageUploads = true;

// The session variable name that CKFinder must use to retrieve the
// "role" of the current user. The "role" is optional and can be used
// in the "AccessControl" settings (bellow in this file).
RoleSessionVar = "CKFinder_UserRole";

// ACL (Access Control) settings. Used to restrict access or features
// to specific folders.
// Several "AccessControl.Add()" calls can be made, which return a
// single ACL setting object to be configured. All properties settings
// are optional in that object.
// Subfolders inherit their default settings from their parents' definitions.
//
// - The "Role" property accepts the special "*" value, which means
// "everybody".
// - The "ResourceType" attribute accepts the special value "*", which
// means "all resource types".
AccessControl acl = AccessControl.Add();
acl.Role = "*";
acl.ResourceType = "*";
acl.Folder = "/";

acl.FolderView = true;
acl.FolderCreate = true;
acl.FolderRename = true;
acl.FolderDelete = true;

acl.FileView = true;
acl.FileUpload = true;
acl.FileRename = true;
acl.FileDelete = true;

// Resource Type settings.
// A resource type is nothing more than a way to group files under
// different paths, each one having different configuration settings.
// Each resource type name must be unique.
// When loading CKFinder, the "type" querystring parameter can be used
// to display a specific type only. If "type" is omitted in the URL,
// the "DefaultResourceTypes" settings is used (may contain the
// resource type names separated by a comma). If left empty, all types
// are loaded.

DefaultResourceTypes = "";

ResourceType type;

type = ResourceType.Add( "Files" );
type.Url = BaseUrl + "files/";
type.Dir = BaseDir == "" ? "" : BaseDir + "files/";
type.MaxSize = 0;
type.AllowedExtensions = new string[] { "7z", "aiff", "asf", "avi", "bmp", "csv", "doc", "docx", "fla", "flv", "gif", "gz", "gzip", "jpeg", "jpg", "mid", "mov",

"mp3", "mp4", "mpc", "mpeg", "mpg", "ods", "odt", "pdf", "png", "ppt", "pptx", "pxd", "qt", "ram", "rar", "rm", "rmi", "rmvb", "rtf", "sdc", "sitd", "swf", "sxc", "sxw", "tar",

"tgz", "tif", "tiff", "txt", "vsd", "wav", "wma", "wmv", "xls", "xlsx", "zip" };
type.DeniedExtensions = new string[] { };

type = ResourceType.Add( "Images" );
type.Url = BaseUrl + "images/";
type.Dir = BaseDir == "" ? "" : BaseDir + "images/";
type.MaxSize = 0;
type.AllowedExtensions = new string[] { "bmp", "gif", "jpeg", "jpg", "png" };
type.DeniedExtensions = new string[] { };

type = ResourceType.Add( "Flash" );
type.Url = BaseUrl + "flash/";
type.Dir = BaseDir == "" ? "" : BaseDir + "flash/";
type.MaxSize = 0;
type.AllowedExtensions = new string[] { "swf", "flv" };
type.DeniedExtensions = new string[] { };
}




</script>



其中标红的为修改过的代码,这样设置了绝对路径虽然达到了效果,可是每个站点都要修改岂不是很麻烦?

第二个问题:当
BaseUrl = "/ckfinder/userfiles/";
BaseDir = "";
我上传到服务器的图片可以立刻显示出缩略图(这是默认上传到C:\Inetpub\wwwroot\ckfinder\userfiles 目录下的图片),但是改成绝对路径后,上传的图片不能立即显示缩略图,要刷新一下才显示,什么问题啊?百思不得其解....

求救 !!!求救!!!!
...全文

相关推荐

Python3 if多条件简写技巧

Python3支持极简if条件写法,简化冗余代码。链式比较:原生支持1<x<10,无需写成x>1 and x<10,可读性更强。三元表达式:适用于二分支逻辑,语法 结果A if 条件 else 结果B,适合单行赋值,禁止多层嵌套三元表达式,会大幅降低可读性。逻辑短路:and左侧为False直接终止判断,or左侧为True直接终止判断,可用于空值兜底,比如name = input_name or "匿名用户"。注意不要混用=和==,新手常误将赋值写在if判断内,Python3会直接抛出语法异常。 6thhosp-east.com 3wfuwu.com ajfcw.net www.ahdmhbkj.cn www.aiyouseo.com

2601_97221235

PHP 代码加密工具 源码保护与站点授权

把 PHP 源码加密成不可直接阅读、难以还原的形式:变量名与控制流被打散重写,载荷带完整性自校验,改一个字节就停止运行。提供编码型 / 混淆型 / 重构型 / 底层型 / 虚拟机型五档保护强度,并可叠加按域名与期限的网站注册授权。

穿透云

【配电网智能软开关和储能联合规划】具有源荷不平衡特性的配电网智能软开关和储能联合规划(Matlab代码实现)

【配电网智能软开关和储能联合规划】具有源荷不平衡特性的配电网智能软开关和储能联合规划(Matlab代码实现)内容概要:本文围绕“具有源荷不平衡特性的配电网智能软开关和储能联合规划”展开,提出了一种结合智能软开关(SOP)与储能系统进行联合优化配置的方法,旨在应对配电网中由于分布式能源波动导致的源荷不平衡问题。该研究利用Matlab实现了完整的仿真代码,构建了优化模型,综合考虑了设备投资成本、运行维护费用、网络损耗及电能质量等因素,通过优化算法求解SOP和储能的最佳配置方案,以提升配电网的灵活性、可靠性和经济性。文中强调该模型为顶级EI复现级别,具备较高的学术参考价值和技术实现细节。; 适合人群:从事电力系统规划、智能电网、分布式能源管理及相关领域的科研人员、高校研究生以及电力行业工程师。; 使用场景及目标:① 用于解决含高比例分布式电源的配电网中因出力波动引起的潮流倒送、电压越限等问题;② 为智能软开关与储能系统的协同配置提供量化决策依据,实现电网灵活资源的优化布局。; 阅读建议:此资源以Matlab代码为核心,重在理论模型与工程实践的结合,建议读者在学习时应同步运行代码,深入理解目标函数构建、约束条件设置及优化求解过程,以便更好地掌握其在实际项目中的应用方法。

程序猿鑫

MATLAB实现三线径向配电系统的前后扫负载流和故障分析.zip

1.版本:matlab2014a/2019b/2024b 2.附赠案例数据可直接运行。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。

海神之光

Python3 for-else特殊语法

Python是唯一自带for-else语法的主流语言,新手极易忽略。else代码块仅在for循环正常遍历结束、未触发break时执行。如果循环内部通过break强制跳出,else代码会直接跳过。典型业务场景:遍历列表查找目标数据,找到就break,找不到执行else输出未查询到。对比传统写法,无需额外定义标记变量,精简代码行数。需要区分else和continue关系:continue仅跳过单次循环,不影响整体遍历,不会阻断else执行。日常开发搜索、匹配场景优先使用该语法,替代flag标记变量,减少冗余代码。 www.2006led.com www.3djf.com acrlzy.com www.432u.cn www.7apm.cn

2601_97221235
评论 4
收藏 已收藏
分享
返回顶部
华丽丽的小低调
C# 111,128 成员 642,536 内容