Skip to content

Instantly share code, notes, and snippets.

@ziadoz
Last active November 24, 2022 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ziadoz/fe24aa7a81fd13e70867d4b39be0b526 to your computer and use it in GitHub Desktop.
Save ziadoz/fe24aa7a81fd13e70867d4b39be0b526 to your computer and use it in GitHub Desktop.
AWS S3 Presigned Upload URL with SSE
<?php
// The X-Amz-Server-Side-Encryption header must be set in formInputs and options, with the correct case.
new PostObjectV4(
$client,
$bucket,
[
'key' => $key,
'acl' => 'private',
'X-Amz-Server-Side-Encryption' => 'AES256',
],
[
['acl' => 'private'],
['bucket' => $bucket],
['key' => $key],
['content-length-range', $size, $size],
['x-amz-server-side-encryption' => 'AES256'],
],
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment