Commit a762b17a authored by Liu lu's avatar Liu lu

上传本地文件到oss

parent daf5c971
...@@ -161,7 +161,7 @@ class UploadOssService ...@@ -161,7 +161,7 @@ class UploadOssService
public function uploadLocalFile(string $localFilePath, string $ossFilePath) public function uploadLocalFile(string $localFilePath, string $ossFilePath)
{ {
$extension = pathinfo(parse_url($localFilePath,PHP_URL_PATH),PATHINFO_EXTENSION); $extension = pathinfo(parse_url($localFilePath,PHP_URL_PATH),PATHINFO_EXTENSION);
$ossFilePath = '/oss2/'.env('APP_ENV').'/'.env('APP_NAME') ."/{$ossFilePath}/". md5($localFilePath).'.'.$extension; $ossFilePath = 'oss2/'.env('APP_ENV').'/'.env('APP_NAME') ."/{$ossFilePath}/". md5($localFilePath).'.'.$extension;
try { try {
$oss = $this->factory->get('oss'); $oss = $this->factory->get('oss');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment