Fckeditor实现WORD粘贴图片自动上传

版权所有 2009-2019 荆门泽优软件有限公司

保留所有权利

官方网站:http://www.ncmem.com/index.aspx

产品首页:http://www.ncmem.com/webapp/wordpaster/index.aspx

开发文档:http://www.ncmem.com/doc/view.aspx?id=29adc89a08ed489498160458cddfa51b

控件下载:http://www.ncmem.com/webapp/wordpaster/pack.aspx

示例下载:http://www.ncmem.com/webapp/wordpaster/versions.aspx

联系信箱:1085617561@qq.com

联系QQ:1085617561

产品交流群:泽优Word一键粘贴控件
扫码加群:
  

1.1. 集成到FCKEditor2.x

主要步骤如下:

1.上传WordPaster文件夹

 

2.上传插件文件夹

 

3.修改配置文件fckconfig.js

FCKEditor2.x工具栏中增加插件按钮

 

4.在引用页面添加初始化代码:

引用页面代码:

<html xmlns=”http://www.w3.org/1999/xhtml” >

<head>

     <meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″ />

     <link type=”text/css” rel=”Stylesheet” href=”WordPaster/css/WordPaster.css”/>

     <link type=”text/css” rel=”Stylesheet” href=”WordPaster/js/skygqbox.css” />

     <script type=”text/javascript” src=”WordPaster/js/json2.min.js” charset=”utf-8″></script>

     <script type=”text/javascript” src=”WordPaster/js/jquery-1.4.min.js” charset=”utf-8″></script>

     <script type=”text/javascript” src=”WordPaster/js/w.edge.js” charset=”utf-8″></script>

     <script type=”text/javascript” src=”WordPaster/js/w.app.js” charset=”utf-8″></script>

     <script type=”text/javascript” src=”WordPaster/js/w.file.js” charset=”utf-8″></script>

     <script type=”text/javascript” src=”WordPaster/js/WordPaster.js” charset=”utf-8″></script>

     <script type=”text/javascript” src=”WordPaster/js/skygqbox.js” charset=”utf-8″></script>

     <script type=”text/javascript” src=”fckeditor/fckeditor.js”></script>

</head>

<body>

     <script language=”javascript” type=”text/javascript”>

        var pasterMgr = new WordPasterManager();

         pasterMgr.Fields[“UserName”] = “test”;

         pasterMgr.Config[“PostUrl“] = “http://localhost:4317/asp.net/upload.aspx”;

         pasterMgr.Load();//加载控件

 

         var oFCKeditor = new FCKeditor(‘FCKeditor1’);

         oFCKeditor.BasePath = “fckeditor/”;

         //oFCKeditor.ToolbarSet = “Basic”;

         oFCKeditor.Height = 300;

         oFCKeditor.Value = ;

         oFCKeditor.Create();

 

         //初始化调协编辑器

         function FCKeditor_OnComplete(editorInstance)

         {

             pasterMgr.SetEditor(editorInstance);

         }

     </script>

</body>

</html>

最终效果如下:

 

说明:

WordPasterManager必须申明成全局变量

 

常见问题:

1.为什么整合到项目中图片无法上传?

可能原因:可能上传页面有登陆验证,上传时没有添加SESSION信息,导致上传失败。可在上传页面增加SESSION参数。