Get file's signed URL from amazon s3 using Filesystem Laravel 5.2

后端 未结 4 647
南旧
南旧 2021-01-30 10:55

I\'m looking for a good solution to get the signed url from amazon s3.

I have a version working with it, but not using laravel:



        
4条回答
  •  难免孤独
    2021-01-30 11:30

    the above explain answer (@brian_d) is ok, but it takes too much time to generate presigned url. i wasted almost 4-5 days to overcome that. finally following worked for me. Thanks to @Kenth.

    use Carbon\Carbon;
    use Illuminate\Support\Facades\Storage;
    
    $disk = Storage::disk('s3');
    $url = $disk->getAwsTemporaryUrl($disk->getDriver()->getAdapter(), $value, Carbon::now()->addMinutes(5), []);
    

提交回复
热议问题