fix: add more mimetypes

This commit is contained in:
Marvin Flock
2025-02-11 11:47:13 +01:00
parent b92b973f8f
commit f0e7a20e6b
@@ -17622,10 +17622,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");