Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how to get private images in s3 laravel

use Storage;
use Config;

$client = Storage::disk('s3')->getDriver()->getAdapter()->getClient();
$bucket = Config::get('filesystems.disks.s3.bucket');

$command = $client->getCommand('GetObject', [
    'Bucket' => $bucket,
    'Key' => '344772707_360.mp4'  // file name in s3 bucket which you want to access
]);

$request = $client->createPresignedRequest($command, '+20 minutes');

// Get the actual presigned-url
echo $presignedUrl = (string)$request->getUri();
Comment

PREVIOUS NEXT
Code Example
Php :: how to make primary key and foreign key in phpmyadmin 
Php :: how to create module in laravel 
Php :: what is php file 
Php :: laravel echo 
Php :: how to run php on windows 
Php :: displaying dates using php code 
Php :: how to append an array into associative array 
Php :: login as user in laravel from admin panel 
Php :: php array in variable 
Php :: public $baseURL codeigniter 4 
Php :: main.php 
Php :: how do i use php read excel file 
Php :: php overriding 
Php :: get the selected value of dropdown php 
Php :: if one condition 
Php :: queue jobs in laravel 
Php :: API json data show in laravel 
Php :: woocommerce custom payment process method 
Php :: laravel permission create role 
Php :: php var_dump() 
Php :: php convert dbf to mysql 
Php :: php system info script 
Php :: php how to concatenate strings 
Php :: elasticsearch php filter range 
Php :: php bin/console debug events 
Php :: Protect Your Site from Malicious Requests 
Php :: how to sum values of two product which are same gst rate and this product are come from foreach loop in php 
Php :: laravel request 
Php :: static functions php 
Php :: Input sanitization to prevent XSS 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =