Skip to content

Commit f79954d

Browse files
thedomeffmjderusse
andauthored
Add hint to the presign documentation how to upload a file (#1673)
* Add hint to the presign documentation how to upload a file I was confused that I can not upload a file until I realized that the Request was explicitly "Get" and I had simply to switch it to "Put" to upload files via the presigned url. * Update docs/features/presign.md --------- Co-authored-by: Jérémy Derussé <[email protected]>
1 parent f64b859 commit f79954d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/features/presign.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,20 @@ for a limited time.
1313

1414
```php
1515
use AsyncAws\S3\Input\GetObjectRequest;
16+
use AsyncAws\S3\Input\PutObjectRequest;
1617
use AsyncAws\S3\S3Client;
1718

1819
$s3 = new S3Client();
20+
// To allow reading of a file use:
1921
$input = new GetObjectRequest([
2022
'Bucket' => 'my-bucket',
2123
'Key' => 'test',
2224
]);
25+
// To allow uploading a file use:
26+
// $input = new PutObjectRequest([
27+
// 'Bucket' => 'my-bucket',
28+
// 'Key' => 'test',
29+
// ]);
2330

2431
$url = $s3->presign($input, new \DateTimeImmutable('+60 min'));
2532

0 commit comments

Comments
 (0)