diff --git a/src/Objects/DirContent.php b/src/Objects/DirContent.php index 3079713..1e1a83c 100644 --- a/src/Objects/DirContent.php +++ b/src/Objects/DirContent.php @@ -26,7 +26,7 @@ readonly class DirContent $fileInfo->getType() ?? 'N/A', $fileInfo->getPath(), $content, - mime_content_type($fileInfo->getFilename()), + mime_content_type($fileInfo->getPath() . '/' . $fileInfo->getFilename()), ); } diff --git a/templates/file.html.twig b/templates/file.html.twig index 6ed481f..81be9b4 100644 --- a/templates/file.html.twig +++ b/templates/file.html.twig @@ -15,7 +15,11 @@
{{ file.content|raw }}
+ {% if file.mimeType starts with 'image' %} +{{ file.content|raw }}
+ {% endif %}