zoukankan      html  css  js  c++  java
  • 整合CKEditor与ckfinder的注意点

    环境说明

    使用的环境是VS2010,.Net4.0,XP,IE8.0, CKEditor.Net 3.6.2,CKFinder2.1.1

    文件准备

    CKEditor复制_Sample目录下ckeditor目录到网站根目录

    CKFinder复制ckfinder目录后删除里面的_sample目录,_source,bin等目录与.txt文件

    调整代码

    调整CKFinder,FileUploadCommandHandler.cs中的SendResponse方法中的代码

    HttpPostedFile oFile = HttpContext.Current.Request.Files[HttpContext.Current.Request.Files.AllKeys[0]];

    改为-->

    if (HttpContext.Current.Request.Files.Count <= 0) return;
        HttpPostedFile oFile = HttpContext.Current.Request.Files[0];

    因为这句老报错,端点后发现有时是Files集合为空造成的

    配置整合

    引用CKEditor.Net.dll与CKFinder.dll,另外在工具箱中加入CKEditor

    在页面初始化(一般是Page_Load)中加入以下代码,使CKEditor启用文件上传功能

            CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
            _FileBrowser.BasePath = "/ckfinder/";
            _FileBrowser.SetupCKEditor(CKEditor1);

  • 相关阅读:
    云计算 备忘录
    python 备忘录
    Linux 备忘录
    appium自动化的一个实例
    appium环境的搭建
    四则运算2单元测试
    四则运算2
    四则运算2程序设计思路
    上课未及时完成的原因
    随机生成30道四则运算题程序设计
  • 原文地址:https://www.cnblogs.com/wdfrog/p/2409531.html
Copyright © 2011-2022 走看看