首先在Storage中新建domin:uploads;
然后修改以下文件
1、Sae.class.php 中修改为:
/** 保存指定文件
* @param array $file 保存的文件信息
* @param boolean $replace 同名文件是否覆盖
* @return boolean 保存状态,true-成功,false-失败
*/
public function save(&$file, $replace=true) {
$filename = ltrim($this->rootPath .'/'. $file['savepath'] . $file['savename'],'/');
$st=new \SaeStorage();
/* 不覆盖同名文件 */
if (!$replace && $st->fileExists($this->domain,$filename)) {
$this->error = '存在同名文件' . $file['savename'];
return false;
}
/* 移动文件 */
$url = $st->upload($this->domain,$filename,$file['tmp_name']);
if (!$url) {
$this->error = '文件上传保存错误!['.$st->errno().']:'.$st->errmsg();
return false;
} else {
$file['url'] = $url;
$file['download'] = $url;
}
return true;
4、图片保存的位置 Application\Home\Model\PictureModel.class.php 修改为:
6、修改: /Addons/EditorForAdmin/Controller/UploadController.class.php
修改: Local 为 Sae
修改: EDITOR_UPLOAD 为 UPLOAD_SAE_CONFIG
然后修改以下文件
1、Sae.class.php 中修改为:
/** 保存指定文件
* @param array $file 保存的文件信息
* @param boolean $replace 同名文件是否覆盖
* @return boolean 保存状态,true-成功,false-失败
*/
public function save(&$file, $replace=true) {
$filename = ltrim($this->rootPath .'/'. $file['savepath'] . $file['savename'],'/');
$st=new \SaeStorage();
/* 不覆盖同名文件 */
if (!$replace && $st->fileExists($this->domain,$filename)) {
$this->error = '存在同名文件' . $file['savename'];
return false;
}
/* 移动文件 */
$url = $st->upload($this->domain,$filename,$file['tmp_name']);
if (!$url) {
$this->error = '文件上传保存错误!['.$st->errno().']:'.$st->errmsg();
return false;
} else {
$file['url'] = $url;
$file['download'] = $url;
}
return true;
}
2、/Application/Admin/Conf/config.php 修改为:
|
3、/Application/Home/Conf/config.php 修改为: |
5、图片取得的函数 Application\Common\Common\function.php x修改为: |
6、修改: /Addons/EditorForAdmin/Controller/UploadController.class.php
修改: Local 为 Sae
修改: EDITOR_UPLOAD 为 UPLOAD_SAE_CONFIG
ps:
Sae.class.php 这个文件在哪