Home >php教程 >php手册 >(代码修正)OT后台KindEditor编辑器图片上传错误

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

WBOY
WBOYOriginal
2016-06-07 11:42:581331browse

代码修正,OT后台KindEditor编辑器图片上传错误.
Addons\EditorForAdmin\Controller\UploadController.class.php/* 上传图片 */<br>     public function upload(){<br>         /* 上传配置 */<br>         $setting = C('EDITOR_UPLOAD');<br> <br>         /* 调用文件上传组件上传文件 */<br>         $this->uploader = new Upload($setting, 'Local');<br>         $info   = $this->uploader->upload($_FILES);<br>         return $info ? $info : false;<br>     }<br> <br>     //keditor编辑器上传图片处理<br>     public function ke_upimg(){<br>         /* 返回标准数据 */<br>         $return  = array('error' => 0, 'info' => '上传成功', 'data' => '');<br>         $img = $this->upload();<br>         /* 记录附件信息 */<br>         if($img){<br>             $img = $img['imgFile'];<br>             $return['url'] = $this->uploader->__get('rootPath').$img['savepath'].$img['savename'];<br>             unset($return['info'], $return['data']);<br>         } else {<br>             $return['error'] = 1;<br>             $return['message']   = $this->uploader->getError();<br>         }<br> <br>         /* 返回JSON数据 */<br>         exit(json_encode($return));<br>     }

AD:真正免费,域名+虚机+企业邮箱=0元

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:地区管理功能Next article:ThinkPHP无限分类模块