andersundsehr / aus_driver_amazon_s3

Provides a TYPO3 FAL driver for the Amazon Web Service S3
GNU Lesser General Public License v3.0
20 stars 39 forks source link

Video Mimetype (youtube, vimeo) is detected wrong #34

Closed onigunn closed 5 years ago

onigunn commented 6 years ago

Requirements

Steps

Result You will see an inline element of type Image.

Investigation Problem is settled in\AUS\AusDriverAmazonS3\Driver\AmazonS3Driver::getMetaInfoFromResponseand the way driver is detecting mime types on files. File meta content is collected by calling the S3 client headObject method. Technically this is not wrong but business logic wise. TYPO3 video "files" are simply JSON files with some metadata. So S3 detects .youtube/.vimeo file as plain/text which causes\TYPO3\CMS\Core\Resource\Index\Indexer to assume on\TYPO3\CMS\Core\Resource\Index\Indexer::getFileType the given file is a text file. By "weird" behavior of backend renderer the inline element shows up as image reference, but this is not related with the S3 driver.

I guess easiest way to handle TYPO3 business logic cases related to files would be to rely for file information tasks to \TYPO3\CMS\Core\Type\File\FileInfo.

p-schlosser commented 6 years ago

Hello there. Is there any workaround for this issue? I add custom fields to files only of type video. So if the file is stored in S3 storage I can't access the custom field.