|
...
|
...
|
@@ -40,11 +40,10 @@ class AmazonS3Service |
|
|
|
* @method :post
|
|
|
|
* @time :2024/1/23 9:20
|
|
|
|
*/
|
|
|
|
public function uploadFiles(&$files, $s3Key,$filename ,$binary = false)
|
|
|
|
public function uploadFiles(&$files, $s3Key,$filename )
|
|
|
|
{
|
|
|
|
$key = $s3Key.'/'.$filename;
|
|
|
|
$Body = $binary ? $files : fopen($files->getRealPath(), 'r');
|
|
|
|
$Body = is_resource($Body) ? stream_get_contents($Body) : $Body;
|
|
|
|
$Body = fopen($files->getRealPath(), 'r');
|
|
|
|
try {
|
|
|
|
$result = $this->s3->putObject([
|
|
|
|
'Bucket' => $this->bucket,
|
...
|
...
|
|