代码修正,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元