summaryrefslogtreecommitdiff
path: root/vendor/aws/aws-sdk-php/src/S3/Transfer.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/aws/aws-sdk-php/src/S3/Transfer.php')
-rw-r--r--vendor/aws/aws-sdk-php/src/S3/Transfer.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/vendor/aws/aws-sdk-php/src/S3/Transfer.php b/vendor/aws/aws-sdk-php/src/S3/Transfer.php
index 68b6736..600f441 100644
--- a/vendor/aws/aws-sdk-php/src/S3/Transfer.php
+++ b/vendor/aws/aws-sdk-php/src/S3/Transfer.php
@@ -27,6 +27,7 @@ class Transfer implements PromisorInterface
private $mupThreshold;
private $before;
private $s3Args = [];
+ private $addContentMD5;
/**
* When providing the $source argument, you may provide a string referencing
@@ -134,6 +135,10 @@ class Transfer implements PromisorInterface
$this->addDebugToBefore($options['debug']);
}
}
+
+ // Handle "add_content_md5" option.
+ $this->addContentMD5 = isset($options['add_content_md5'])
+ && $options['add_content_md5'] === true;
}
/**
@@ -141,7 +146,7 @@ class Transfer implements PromisorInterface
*
* @return PromiseInterface
*/
- public function promise()
+ public function promise(): PromiseInterface
{
// If the promise has been created, just return it.
if (!$this->promise) {
@@ -342,6 +347,7 @@ class Transfer implements PromisorInterface
$args = $this->s3Args;
$args['SourceFile'] = $filename;
$args['Key'] = $this->createS3Key($filename);
+ $args['AddContentMD5'] = $this->addContentMD5;
$command = $this->client->getCommand('PutObject', $args);
$this->before and call_user_func($this->before, $command);
@@ -361,6 +367,7 @@ class Transfer implements PromisorInterface
'before_upload' => $this->before,
'before_complete' => $this->before,
'concurrency' => $this->concurrency,
+ 'add_content_md5' => $this->addContentMD5
]))->promise();
}