Answers for "laravel s3 temporary url"

PHP
1

laravel s3 presigned url

$s3 = \Storage::disk('s3');
$client = $s3->getDriver()->getAdapter()->getClient();
$expiry = "+10 minutes";

$command = $client->getCommand('GetObject', [
    'Bucket' => \Config::get('filesystems.disks.s3.bucket'),
    'Key'    => "file/in/s3/bucket"
]);

$request = $client->createPresignedRequest($command, $expiry);

return (string) $request->getUri();
Posted by: Guest on May-03-2020
0

laravel s3 download file

return Storage::download('file.jpg');

return Storage::download('file.jpg', $name, $headers);
Posted by: Guest on August-05-2020

Browse Popular Code Answers by Language