Amazon S3 SDK: change file name on boot?

Is this the right way to create a url and change the upload name?

$s3 = new AmazonS3();
$opt =  array('response' => array('Content-Disposition' => 'attachment; "filename=newname.txt"'));
$url = $s3->get_object_url('bucket', 'file.txt', '5 minutes', $opt));

Apparently not working with me.

+5
source share
1 answer

After several tests, apparently get_object_url requires the Content-Disposition parameter in lowercase.

Note that this does not apply to create_object , which works case-insensitively.

So the working code for above:

$opt =  array('response' => array('content-disposition' => 'attachment; "filename=newname.txt"'));
+6
source

All Articles