Skip to content

Commit

Permalink
Workaround: Wrong content-type when resource:copy to Minio
Browse files Browse the repository at this point in the history
This is a workaround for flownative#56
  • Loading branch information
Christoph Lehmann committed Feb 10, 2022
1 parent efe850f commit 9f98602
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Classes/S3Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,12 @@ protected function importTemporaryFile(string $temporaryPathAndFilename, string
$resource->setCollectionName($collectionName);
$resource->setSha1($sha1Hash);

// Workaround for https://github.com/flownative/flow-aws-s3/issues/56; Also remove .tmp ending because it will also result in wrong mime type
$newName = str_replace('.tmp', '', $temporaryPathAndFilename);
rename($temporaryPathAndFilename, $newName);
$temporaryPathAndFilename = $newName;
$resource->setMediaType(mime_content_type($temporaryPathAndFilename));

try {
$this->s3Client->headObject([
'Bucket' => $this->bucketName,
Expand Down

0 comments on commit 9f98602

Please sign in to comment.