Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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();
 
PREVIOUS NEXT
Tagged: #laravel #presigned #url
ADD COMMENT
Topic
Name
4+7 =