Merge pull request #55 from Deutscher-Tischfussballbund/mimetypes

fix: add more mimetypes
This commit is contained in:
MarvinF
2025-04-21 18:05:53 +02:00
committed by GitHub
@@ -16692,10 +16692,18 @@ function terminDokument() {
}
$extension = strtolower(JFile::getExt($dokumente[0]));
if ($extension == "pdf")
$mm_type = "application/pdf";
else
$mm_type = "application/octet-stream";
$mimeTypes = [
'jpg' => 'image/jpeg',
'jpeg' => 'image/jpeg',
'png' => 'image/png',
'webp' => 'image/webp',
'pdf' => 'application/pdf',
'txt' => 'text/plain'
// Add more as needed
];
// Return the corresponding MIME type or a default
$mm_type = $mimeTypes[$extension] ?? 'application/octet-stream';
ob_end_clean(); // Wegen UTF-8-Zeichen, die in der ausgabe vorhanden sind
header("Pragma: public");