【发布时间】:2014-04-06 00:49:16
【问题描述】:
我在我的 asp.net 项目中使用 CKFinder 2.4.1.2663 和 CKEditor 3.6.4.0。我可以上传图片,但是当我尝试上传任何文件(如 doc、xls 或 pdf)并单击将其发送到服务器按钮时,它会显示此错误:文件扩展名无效。
在我后面的代码中我写了这个:
protected override void OnLoad(EventArgs e)
{
CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
_FileBrowser.BasePath = "/ckfinder/";
_FileBrowser.SetupCKEditor(CKEditor1);
}
并且在 Config.ascx 我已经更改了这段代码
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;
}
我正在像这样使用我的 aspx 中的控件
<CKEditor:CKEditorControl ID="CKEditor1" runat="server"></CKEditor:CKEditorControl>
我必须将 CKFinder 用于图像和任何类型的文件扩展名。我哪里做错了?
【问题讨论】:
标签: c# asp.net ckeditor fckeditor ckfinder