"application/pdf", "xls"=>"application/vnd.ms-excel", "doc"=>"application/msword", "txt"=>"text/plain", "csv"=>"text/csv", "xlsx"=>"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "docx"=>"application/vnd.openxmlformats-officedocument.wordprocessingml.document"); $pos=strrpos($_GET['dtnr'],"."); $lenght=strlen($_GET['dtnr']); $mime=substr($_GET['dtnr'], $pos+1,$lenght-$pos); $mimeType=$_allowedApplications[$mime]; if(file_exists($filepath)){ $headerstring="'Content-type: ".$mimeType."'"; header($headerstring); header('Content-Disposition: attachment; filename="'.basename($filepath).'"'); readfile($filepath); exit; //echo '
',var_dump($mimeType),'
'; }else{ echo "FEHLER! ERROR 404 -Datei nicht gefunden!
Es ist ein Download-Fehler aufgetreten.
Die Datei wurde nicht erstellt.
Bitte wenden Sie sich an den WEB-Admin.
"; } ?>