1

除了浏览服务器和其他功能外,我的 ckeditor 效果很好。

在ckeditor的配置文件中

    CKEDITOR.editorConfig = function (config) {
    config.htmlEncodeOutput = true,
    config.filebrowserBrowseUrl = true,
    config.filebrowserImageBrowseUrl=true
   };

    var editor = CKEDITOR.replace("profiel_lange_beschrijving", { toolbar: 'Full' });
    CKFinder.setupCKEditor(editor, '~/Scripts/ckfinder');
    CKEDITOR.replace('editor',
    {
    filebrowserBrowseUrl: '~/Scripts/ckfinder/ckfinder.html',
    filebrowserImageBrowseUrl: '~/Scripts/ckfinder/ckfinder.html?type=Images',

   filebrowserUploadUrl: '~/Scripts/ckfinder/core/connector/aspx/connector.aspx? command=QuickUpload&type=Files',
    filebrowserImageUploadUrl: '~/Scripts/ckfinder/core/connector/aspx/connector.aspx?   command=QuickUpload&type=Images'
  command=QuickUpload&type=Flash'
});

如何成功地将 ckfinder 集成到 ckeditor 中?请帮助朋友

4

2 回答 2

3

将 Ckfinder 集成到 ckeditor 中。然后将其添加到您的 Razor 视图中

CKEDITOR.replace('editor',
{
 filebrowserImageBrowseUrl: '/Scripts/ckfinder/ckfinder.html?type=UploadedImages',
 filebrowserUploadUrl: '/Scripts/ckfinder/core/connector/aspx/connector.aspx?       command=QuickUpload&type=Files',
 filebrowserImageUploadUrl:'/UploadImage/Upload'

}
);

其中 'editor' 是文本框 id 。

然后创建一个 UploadImage 控制器

  public ActionResult Upload(HttpPostedFileBase upload, string CKEditorFuncNum, string CKEditor, string langCode)
    {
        string url; // url to return
        string message; // message to display (optional)
        message = "Image successfully saved ";

   //do save image code here
        url =  "/" + path + "/" + filename;
      string output = @"<html><body><script>window.parent.CKEDITOR.tools.callFunction(" + CKEditorFuncNum + ", \"" + url + "\", \"" + message + "\");</script></body></html>";

            return Content(output);
        }

试试这个效果很好

于 2012-06-18T10:38:12.833 回答
1

你可能把事情复杂化了。这是 CKFinder安装指南的链接和配置指南的链接,两者都适用于 CKFinder 的ASP.NET版本。

于 2012-05-31T12:41:12.777 回答