Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong content type when resource:copy to Minio #56

Open
christophlehmann opened this issue Feb 9, 2022 · 2 comments
Open

Wrong content type when resource:copy to Minio #56

christophlehmann opened this issue Feb 9, 2022 · 2 comments

Comments

@christophlehmann
Copy link
Contributor

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 returns application/octet-stream because $temporaryPathAndFilename does not have the original filename containing the fileExtension which is used in getMediaType() 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 the neos_flow_resourcemanagement_persistentresource table, it's rather a workaround.

christophlehmann pushed a commit to networkteam/flow-aws-s3 that referenced this issue Feb 9, 2022
christophlehmann pushed a commit to networkteam/flow-aws-s3 that referenced this issue Feb 10, 2022
christophlehmann pushed a commit to networkteam/flow-aws-s3 that referenced this issue Feb 10, 2022
@kdambekalns
Copy link
Member

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?

@christophlehmann
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants