How do I download a file with php and the Amazon S3 sdk?

后端 未结 6 1953
不思量自难忘°
不思量自难忘° 2020-12-15 21:01

I\'m trying to make it so that my script will show test.jpg in an Amazon S3 bucket through php. Here\'s what I have so far:

require_once(\'library/AWS/sdk.cl         


        
6条回答
  •  长情又很酷
    2020-12-15 21:40

    I added the Content-Disposition header to the getAuthenticatedUrl();

     // Example
     $timeOut = 3600; // in seconds
     $videoName = "whateveryoulike";
     $headers = array("response-content-disposition"=>"attachment");
     $downloadURL = $s3->getAuthenticatedUrl( FBM_S3_BUCKET, $videoName, FBM_S3_LIFETIME + $timeOut, true, true, $headers );
    

提交回复
热议问题