Skip to content

Commit

Permalink
Keep miemtype handling for writeObject
Browse files Browse the repository at this point in the history
  • Loading branch information
tsdicloud committed May 7, 2021
1 parent cafb437 commit f139d2b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/private/Files/ObjectStore/S3ObjectTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,13 @@ public function readObject($urn) {
}

/**
* @param string $urn the unified resource name used to identify the object
* @param string $urn the unified resource name used to identify the object
* @param resource $stream stream with the data to write
*
* @param string|null $mimetype the mimetype to set for the remove object @since 22.0.0
* @throws \Exception when something goes wrong, message will be logged
*
* @since 7.0.0
*/
public function writeObject($urn, $stream) {
public function writeObject($urn, $stream, string $mimetype = null)
$count = 0;
$countStream = CallbackWrapper::wrap($stream, function ($read) use (&$count) {
$count += $read;
Expand All @@ -102,7 +101,9 @@ public function writeObject($urn, $stream) {
'bucket' => $this->bucket,
'key' => $urn,
'part_size' => $this->uploadPartSize,
'params' => $this->getSseKmsPutParameters(),
'params' => [
'ContentType' => $mimetype
] + $this->getSseKmsPutParameters(),
];
$uploader = new MultipartUploader($this->getConnection(), $countStream, $s3params);

Expand Down Expand Up @@ -148,7 +149,7 @@ public function deleteObject($urn) {
public function objectExists($urn) {
return $this->getConnection()->doesObjectExist($this->bucket, $urn);
}

/**
* S3 copy command with SSE KMS key handling.
*/
Expand Down

0 comments on commit f139d2b

Please sign in to comment.