|
...
|
...
|
@@ -39,6 +39,12 @@ class UpFiles extends Common |
|
|
|
// 获取表单上传文件
|
|
|
|
$file = request()->file($fileKey['0']);
|
|
|
|
$obj = $file->getInfo();
|
|
|
|
if($obj['size']> 122880){
|
|
|
|
$result['code'] =0;
|
|
|
|
$result['info'] = "图片超出125KB";
|
|
|
|
$result['url'] = '';
|
|
|
|
return $result;
|
|
|
|
}
|
|
|
|
$rs = array('code' => 0, 'url' => '');
|
|
|
|
$tmpName = $obj['tmp_name'];
|
|
|
|
$name = md5($obj['name'] . $_SERVER['REQUEST_TIME']);
|
|
...
|
...
|
@@ -186,4 +192,49 @@ class UpFiles extends Common |
|
|
|
return $result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//获取七牛存储信息
|
|
|
|
public function getBuildBatchStat(){
|
|
|
|
|
|
|
|
//获取单文件
|
|
|
|
/*$accessKey = 'uva-aaonM8dukeR6phc9yuPBrOXk9brrNW_PxLD7';
|
|
|
|
$secretKey = 'oZMMVN6phk49lG0J1xwmi1Ju0ETT15EnAEWcU9Cs';
|
|
|
|
$bucket = 'colorcun-pc';
|
|
|
|
$key = "测试.jpg";
|
|
|
|
$auth = new Auth($accessKey, $secretKey);
|
|
|
|
$config = new \Qiniu\Config();
|
|
|
|
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
|
|
|
|
list($fileInfo, $err) = $bucketManager->stat($bucket, $key);
|
|
|
|
if ($err) {
|
|
|
|
print_r($err);
|
|
|
|
} else {
|
|
|
|
print_r($fileInfo);
|
|
|
|
}*/
|
|
|
|
|
|
|
|
//获取多文件
|
|
|
|
$accessKey = 'uva-aaonM8dukeR6phc9yuPBrOXk9brrNW_PxLD7';
|
|
|
|
$secretKey = 'oZMMVN6phk49lG0J1xwmi1Ju0ETT15EnAEWcU9Cs';
|
|
|
|
$bucket = 'colorcun-pc';
|
|
|
|
$auth = new Auth($accessKey, $secretKey);
|
|
|
|
$bucketManager = new BucketManager($auth);
|
|
|
|
// 要列取文件的公共前缀
|
|
|
|
$prefix = 'aa';
|
|
|
|
// 上次列举返回的位置标记,作为本次列举的起点信息。
|
|
|
|
$marker = '';
|
|
|
|
// 本次列举的条目数
|
|
|
|
$limit = 100;
|
|
|
|
$delimiter = '/';
|
|
|
|
// 列举文件
|
|
|
|
list($ret, $err) = $bucketManager->listFiles($bucket, $prefix, $marker, $limit, $delimiter);
|
|
|
|
if ($err !== null) {
|
|
|
|
echo "\n====> list file err: \n";
|
|
|
|
var_dump($err);
|
|
|
|
} else {
|
|
|
|
if (array_key_exists('marker', $ret)) {
|
|
|
|
echo "Marker:" . $ret["marker"] . "\n";
|
|
|
|
}
|
|
|
|
echo "\nList Iterms====>\n";
|
|
|
|
print_r($ret['items']);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|