<h2 style="box-sizing: inherit; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; text-size-adjust: none; font-family: "Helvetica Neue", NotoSansHans-Regular, AvenirNext-Regular, arial, "Hiragino Sans GB", "Microsoft Yahei", "WenQuanYi Micro Hei", Arial, Helvetica, sans-serif; padding: 0px 0px 0.3em; font-weight: 400; line-height: 1.225; margin: 0px 0px 14px; font-size: 1.3em; border-bottom: 1px solid rgb(238, 238, 238); color: rgb(82, 82, 82); white-space: normal; background-color: rgb(255, 255, 255);">
<span style="box-sizing: inherit; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; text-size-adjust: none; font-weight: bolder;">系统上传配置</span>
</h2>
<p style="box-sizing: inherit; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; text-size-adjust: none; line-height: 2; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(82, 82, 82); font-family: "Helvetica Neue", NotoSansHans-Regular, AvenirNext-Regular, arial, "Hiragino Sans GB", "Microsoft Yahei", "WenQuanYi Micro Hei", serif; font-size: 15px; white-space: normal; background-color: rgb(255, 255, 255);">
系统默认图片等信息上传至阿里云OSS 如不需要上传至OSS 可按照下面步骤修改上传至本地
</p>
<p style="box-sizing: inherit; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; text-size-adjust: none; line-height: 2; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(82, 82, 82); font-family: "Helvetica Neue", NotoSansHans-Regular, AvenirNext-Regular, arial, "Hiragino Sans GB", "Microsoft Yahei", "WenQuanYi Micro Hei", serif; font-size: 15px; white-space: normal; background-color: rgb(255, 255, 255);">
<span style="box-sizing: inherit; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; text-size-adjust: none; font-weight: bolder;">修改配置文件:</span>
</p>
<blockquote class="default" style="box-sizing: inherit; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; text-size-adjust: none; line-height: 1.2; margin: 14px 0px; padding: 5px 5px 5px 15px; border-left: 4px solid rgb(221, 221, 221); color: rgb(119, 119, 119); font-family: "Helvetica Neue", NotoSansHans-Regular, AvenirNext-Regular, arial, "Hiragino Sans GB", "Microsoft Yahei", "WenQuanYi Micro Hei", serif; font-size: 15px; white-space: normal; background-color: rgb(255, 255, 255);">
<p style="box-sizing: inherit; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; text-size-adjust: none; line-height: 2; margin-top: 0px; margin-bottom: 0px; padding: 0px;">
路径:App/Common/Conf/config.php
</p>
</blockquote>
<p style="box-sizing: inherit; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; text-size-adjust: none; line-height: 2; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(82, 82, 82); font-family: "Helvetica Neue", NotoSansHans-Regular, AvenirNext-Regular, arial, "Hiragino Sans GB", "Microsoft Yahei", "WenQuanYi Micro Hei", serif; font-size: 15px; white-space: normal; background-color: rgb(255, 255, 255);">
默认参数:
</p>
<pre style="box-sizing: inherit; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; text-size-adjust: none; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; font-size: 15px; line-height: 1.45; margin-top: 14px; margin-bottom: 14px; padding: 16px; background-color: rgb(247, 247, 247); border: 0px; border-radius: 3px; overflow: auto; color: rgb(82, 82, 82);"> 'FILE_UPLOAD_TYPE' => 'Oss',</pre>
<p style="box-sizing: inherit; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; text-size-adjust: none; line-height: 2; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(82, 82, 82); font-family: "Helvetica Neue", NotoSansHans-Regular, AvenirNext-Regular, arial, "Hiragino Sans GB", "Microsoft Yahei", "WenQuanYi Micro Hei", serif; font-size: 15px; white-space: normal; background-color: rgb(255, 255, 255);">
修改为本地存储则为
</p>
<pre style="box-sizing: inherit; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; text-size-adjust: none; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; font-size: 15px; line-height: 1.45; margin-top: 14px; margin-bottom: 14px; padding: 16px; background-color: rgb(247, 247, 247); border: 0px; border-radius: 3px; overflow: auto; color: rgb(82, 82, 82);"> 'FILE_UPLOAD_TYPE' => 'local',</pre>
<p style="box-sizing: inherit; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; text-size-adjust: none; line-height: 2; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(82, 82, 82); font-family: "Helvetica Neue", NotoSansHans-Regular, AvenirNext-Regular, arial, "Hiragino Sans GB", "Microsoft Yahei", "WenQuanYi Micro Hei", serif; font-size: 15px; white-space: normal; background-color: rgb(255, 255, 255);">
<span style="box-sizing: inherit; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; text-size-adjust: none; font-weight: bolder;">还有一处需要修改:</span>
</p>
<blockquote class="default" style="box-sizing: inherit; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; text-size-adjust: none; line-height: 1.2; margin: 14px 0px; padding: 5px 5px 5px 15px; border-left: 4px solid rgb(221, 221, 221); color: rgb(119, 119, 119); font-family: "Helvetica Neue", NotoSansHans-Regular, AvenirNext-Regular, arial, "Hiragino Sans GB", "Microsoft Yahei", "WenQuanYi Micro Hei", serif; font-size: 15px; white-space: normal; background-color: rgb(255, 255, 255);">
<p style="box-sizing: inherit; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; text-size-adjust: none; line-height: 2; margin-top: 0px; margin-bottom: 0px; padding: 0px;">
路径:App/Plugs/Controller/UploadController.class.php
</p>
</blockquote>
<p style="box-sizing: inherit; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; text-size-adjust: none; line-height: 2; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(82, 82, 82); font-family: "Helvetica Neue", NotoSansHans-Regular, AvenirNext-Regular, arial, "Hiragino Sans GB", "Microsoft Yahei", "WenQuanYi Micro Hei", serif; font-size: 15px; white-space: normal; background-color: rgb(255, 255, 255);">
查找function localUpload方法:<br/>默认代码:
</p>
<pre style="box-sizing: inherit; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; text-size-adjust: none; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; font-size: 15px; line-height: 1.45; margin-top: 14px; margin-bottom: 14px; padding: 16px; background-color: rgb(247, 247, 247); border: 0px; border-radius: 3px; overflow: auto; color: rgb(82, 82, 82);"> if(!$info) {// 上传错误提示错误信息
$error=1;
$msg=$upload->getError();
}else{// 上传成功 获取上传文件信息
$error=0;
$msg= substr($upload->rootPath,1,-1).'/'.$info['file']['savepath'].$info['file']['savename'];
/*保存附件信息到系统附件统计数据库*/
if(domain_auth()) {
$datas = array(
'name' => $info['file']['name'],
'size' => intval($info['file']['size']),
'createtime' => date('Y-m-d H:i:s'),
'type' => $info['file']['type'] . '-' . $info['file']['ext'],
'path' => ALI_OSS() . $msg,
'domain_auth' => domain_auth()
);
}else{
$datas = array(
'name' => $info['file']['name'],
'size' => intval($info['file']['size']),
'createtime' => date('Y-m-d H:i:s'),
'type' => $info['file']['type'] . '-' . $info['file']['ext'],
'path' => ALI_OSS() . $msg,
'domain_auth' => domain_rel()
);
}
M('attachment')->add($datas);
}
return array('error'=>$error,'file'=>$info['file'],'msg'=>ALI_OSS().$msg);</pre>
<p style="box-sizing: inherit; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; text-size-adjust: none; line-height: 2; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(82, 82, 82); font-family: "Helvetica Neue", NotoSansHans-Regular, AvenirNext-Regular, arial, "Hiragino Sans GB", "Microsoft Yahei", "WenQuanYi Micro Hei", serif; font-size: 15px; white-space: normal; background-color: rgb(255, 255, 255);">
修改为:
</p>
<pre style="box-sizing: inherit; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; text-size-adjust: none; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; font-size: 15px; line-height: 1.45; margin-top: 14px; margin-bottom: 0px; padding: 16px; background-color: rgb(247, 247, 247); border: 0px; border-radius: 3px; overflow: auto; color: rgb(82, 82, 82);"> if(!$info) {// 上传错误提示错误信息
$error=1;
$msg=$upload->getError();
}else{// 上传成功 获取上传文件信息
$error=0;
$msg= substr($upload->rootPath,1,-1).'/'.$info['file']['savepath'].$info['file']['savename'];
/*保存附件信息到系统附件统计数据库*/
if(C('FILE_UPLOAD_TYPE')=='Oss') {
$set_path=ALI_OSS();
}else{
$set_path='';
}
if(domain_auth()) {
$datas = array(
'name' => $info['file']['name'],
'size' => intval($info['file']['size']),
'createtime' => date('Y-m-d H:i:s'),
'type' => $info['file']['type'] . '-' . $info['file']['ext'],
'path' => $set_path . $msg,
'domain_auth' => domain_auth()
);
}else{
$datas = array(
'name' => $info['file']['name'],
'size' => intval($info['file']['size']),
'createtime' => date('Y-m-d H:i:s'),
'type' => $info['file']['type'] . '-' . $info['file']['ext'],
'path' =>$set_path . $msg,
'domain_auth' => domain_rel()
);
}
M('attachment')->add($datas);
}
return array('error'=>$error,'file'=>$info['file'],'msg'=>$set_path.$msg);</pre>
<p>
<br/>
</p>