diff --git a/lib/private/Files/ObjectStore/S3ObjectTrait.php b/lib/private/Files/ObjectStore/S3ObjectTrait.php index 8b8cc444ad99e..a81e215db6d88 100644 --- a/lib/private/Files/ObjectStore/S3ObjectTrait.php +++ b/lib/private/Files/ObjectStore/S3ObjectTrait.php @@ -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; @@ -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); @@ -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. */