上传图片工具,KindEditor图片上传

KindEditor图片上传

 (2011-05-08 12:19:11)
   
通过KindEditor实现图片上传功能步骤:
 
(1)修改../plugins/image.js文件中fileName类型为file的name
 
 (2) 添加上传处理的URL:
 
 var editor;
     KindEditor.ready(function(K) {
 
         editor = K.create('#myeditor', 
 
        {
             uploadJson : '/uploadImg'
         });
 
  });
 
(3)返回Json的信息:
 
//成功时 { "error" : 0, "url" : "http://www.example.com/path/to/file.ext" }
//失败时 { "error" : 1, "message" : "错误信息" }
posted @ 2015-10-20 14:09  R142857  阅读(93)  评论(0编辑  收藏  举报