(代码修正)OT后台KindEditor编辑器图片上传错误

浏览:1798 发布日期:2013/12/24 分类:系统代码 关键字: OT KindEditor 上传错误
代码修正,OT后台KindEditor编辑器图片上传错误.
Addons\EditorForAdmin\Controller\UploadController.class.php/* 上传图片 */
    public function upload(){
        /* 上传配置 */
        $setting = C('EDITOR_UPLOAD');

        /* 调用文件上传组件上传文件 */
        $this->uploader = new Upload($setting, 'Local');
        $info   = $this->uploader->upload($_FILES);
        return $info ? $info : false;
    }

    //keditor编辑器上传图片处理
    public function ke_upimg(){
        /* 返回标准数据 */
        $return  = array('error' => 0, 'info' => '上传成功', 'data' => '');
        $img = $this->upload();
        /* 记录附件信息 */
        if($img){
            $img = $img['imgFile'];
            $return['url'] = $this->uploader->__get('rootPath').$img['savepath'].$img['savename'];
            unset($return['info'], $return['data']);
        } else {
            $return['error'] = 1;
            $return['message']   = $this->uploader->getError();
        }

        /* 返回JSON数据 */
        exit(json_encode($return));
    }
评论( 相关
后面还有条评论,点击查看>>