I’m having an issue with generating a presigned URL for S3 using AWS SDK for PHP. Here is my request, $s3 is an instance of S3Client:
$request = $s3->createPresignedRequest($s3->getCommand('getObject',array(
'Bucket' => $myBucket,
'Key' => $filename,
'ContentDisposition' => 'inline'
)),
'+1 hour');
After looking around on stack overflow, and running through every page of documentation on the SDK I can find, I’ve tried setting ‘ContentDisposition’, ‘ResponseContentDisposition’, ‘response_content_disposition’ and ‘Content-Disposition’ in the headers, to no avail.
No matter what, the content disposition is set as “attachment” and clicking the presigned URL starts a download of the file. I’ve also experimented with the same headers above when I’m sending the object with putObject – still no luck. Any ideas?