这个地方有3处,都要在找到的代码下面添加
//开启七牛云global $cfg_qiniu, $cfg_qiniudomain;if($cfg_qiniu == 'Y') { $ret = $this->QiniuUpload(preg_replace('///','',$this->fullName,1), $this->filePath); if($ret['status'] == 1) { $this->fullName = $cfg_qiniudomain.$this->fullName; } }完成。
织梦自带采集支持上传附件到七牛云教程打开 /include/dedecollection.class.php 找到
@set_time_limit(0);在它的下面加入
//开启七牛云require_once(DEDEINC.'/qiniu/autoload.php');use QiniuAuth;use QiniuStorageUploadManager;继续找到
global $notckpic;在它的下面加入
global $cfg_qiniu, $cfg_qiniuak, $cfg_qiniusk, $cfg_qiniubucket, $cfg_qiniudomain;继续找到
if($tofile=='')它的上面加入
//开启七牛云if($cfg_qiniu == 'Y') { $auth = new Auth($cfg_qiniuak, $cfg_qiniusk); $token = $auth->uploadToken($cfg_qiniubucket); $uploadMgr = new UploadManager(); $key = preg_replace('///','',$filename,1); list($ret, $err) = $uploadMgr->putFile($token, $key, $GLOBALS['cfg_basedir'].$filename); }最后找到
return $filename;改成
//开启七牛云if($cfg_qiniu == 'Y') { $auth = new Auth($cfg_qiniuak, $cfg_qiniusk); $token = $auth->uploadToken($cfg_qiniubucket); $uploadMgr = new UploadManager(); $key = preg_replace('///','',$filename,1); list($ret, $err) = $uploadMgr->putFile($token, $key, $GLOBALS['cfg_basedir'].$filename); }return $cfg_qiniudomain.$filename;