Commit 69b68780 authored by chentianyu's avatar chentianyu

uploadLocalFile url

parent e75e021a
...@@ -187,7 +187,10 @@ class UploadOssService ...@@ -187,7 +187,10 @@ 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;
$fileName = $this->genUniqueFileName() . '.' . $extension;
$ossFilePath = 'oss2/'. $this->appDev .'/'. $this->appName ."/{$ossFilePath}/". today() .'/'. $fileName;
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