Skip to content

Commit f139d2b

Browse files
committed
Keep miemtype handling for writeObject
Signed-off-by: [email protected] <[email protected]>
1 parent cafb437 commit f139d2b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lib/private/Files/ObjectStore/S3ObjectTrait.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,13 @@ public function readObject($urn) {
8585
}
8686

8787
/**
88-
* @param string $urn the unified resource name used to identify the object
88+
* @param string $urn the unified resource name used to identify the object
8989
* @param resource $stream stream with the data to write
90-
*
90+
* @param string|null $mimetype the mimetype to set for the remove object @since 22.0.0
9191
* @throws \Exception when something goes wrong, message will be logged
92-
*
9392
* @since 7.0.0
9493
*/
95-
public function writeObject($urn, $stream) {
94+
public function writeObject($urn, $stream, string $mimetype = null)
9695
$count = 0;
9796
$countStream = CallbackWrapper::wrap($stream, function ($read) use (&$count) {
9897
$count += $read;
@@ -102,7 +101,9 @@ public function writeObject($urn, $stream) {
102101
'bucket' => $this->bucket,
103102
'key' => $urn,
104103
'part_size' => $this->uploadPartSize,
105-
'params' => $this->getSseKmsPutParameters(),
104+
'params' => [
105+
'ContentType' => $mimetype
106+
] + $this->getSseKmsPutParameters(),
106107
];
107108
$uploader = new MultipartUploader($this->getConnection(), $countStream, $s3params);
108109

@@ -148,7 +149,7 @@ public function deleteObject($urn) {
148149
public function objectExists($urn) {
149150
return $this->getConnection()->doesObjectExist($this->bucket, $urn);
150151
}
151-
152+
152153
/**
153154
* S3 copy command with SSE KMS key handling.
154155
*/

0 commit comments

Comments
 (0)