作者 lyh

gx

... ... @@ -66,7 +66,7 @@ class AmazonS3Service
*/
public function syncImageFiles($files)
{
$location = ltrim(str_replace_url($files),'/');
$location = '/tmp'.str_replace_url($files);
$file_link = $this->fetchRemoteImage($files,$location);
$key = str_replace_url($files);
try {
... ... @@ -82,6 +82,7 @@ class AmazonS3Service
'Key' => ltrim($key,'/'),
'Body' => $file_content,
]);
unlink($location);
return $result['ObjectURL'];
} catch (AwsException $e) {
return '上传文件到S3时发生错误:' . $e->getMessage();
... ...