Fetch the repository succeeded.
This action will force synchronization from YHGJ/lmshop_kj, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
<?php
define('IN_ECS', true);
require(dirname(__FILE__) . '/includes/init.php');
require ROOT_PATH . '/includes/must_login.php';
require(dirname(__FILE__) . '/plugins/aliyunoss/autoload.php');
include('includes/cls_json.php');
$json = new JSON;
$res = array('err_msg' => '', 'err_no' => 0, 'result' => '');
$rootPath = ROOT_PATH; // 设置附件上传根目录
$act = isset($_REQUEST['act']) ? addslashes_deep($_REQUEST['act']) : 'upload';
$bucket = isset($_REQUEST['bucket']) ? addslashes_deep($_REQUEST['bucket']) : '';
$keyid = isset($_REQUEST['keyid']) ? addslashes_deep($_REQUEST['keyid']) : '';
$keysecret = isset($_REQUEST['keysecret']) ? addslashes_deep($_REQUEST['keysecret']) : '';
$endpoint = isset($_REQUEST['endpoint']) ? addslashes_deep($_REQUEST['endpoint']) : '';
$is_cname = isset($_REQUEST['is_cname']) ? intval($_REQUEST['is_cname']) : 1;
$object = isset($_REQUEST['object']) ? $_REQUEST['object'] : array();
$file = '';
if($is_cname == 1){
$is_cname = true;
}else{
$is_cname = false;
}
$ossClient = new \OSS\OssClient($keyid, $keysecret, $endpoint, $is_cname);
/*
*----------------------------
*阿里云OSS文件上传
*----------------------------
*/
if($act == 'upload'){
if(is_array($object)){
foreach($object as $row){
if($row){
$file = $rootPath . $row;
$objects = $row;
$ossClient->putObject($bucket, $objects, '{$row}');
$ossClient->uploadFile($bucket, $objects, $file);
}
}
}else{
$file = $rootPath . $object;
$ossClient->putObject($bucket, $object, '{$object}');
$ossClient->uploadFile($bucket, $object, $file);
}
}
/*
*----------------------------
*阿里云OSS文件删除
*----------------------------
*/
elseif($act == 'del_file'){
$ossClient->deleteObjects($bucket, $object); //删除对象文件
}
die($json->encode($object));
?>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。