Open christophlehmann opened 2 years ago
Well, you say
the correct content type is already in the
neos_flow_resourcemanagement_persistentresource
table
Then why is the resource imported (again) using importResourceFromContent()
, which by defintiion only sees the content, but never a filename?
Or am I misunderstanding something here?
Hey, this is about copying resources from local persistent storage to S3 storage. In resource:copy
\Flownative\Aws\S3\S3Storage::importResource()
is called, but it sadly gets no PersistentResource
object, which could be used to use put original meta data from the database record into S3. So, the patch is just a workaround until importResource()
can receive a PersistentResource
object.
Using Minio and evaluating the one-bucket setup i face that copied resources always get the content type application/octet-stream.
In https://github.com/flownative/flow-aws-s3/blob/master/Classes/S3Storage.php#L225
getMediaType()
always returnsapplication/octet-stream
because$temporaryPathAndFilename
does not have the original filename containing the fileExtension which is used ingetMediaType()
to detect the content-type by filename.What works is using
mime_content_type($temporaryTargetPathAndFilename)
, but during the fact, that the correct content type is already in theneos_flow_resourcemanagement_persistentresource
table, it's rather a workaround.