Edit:
Hab das ganze jetzt mal etwas gekürzt:
function sendFileToBrowser($filename){
$filelocation = $_SERVER['DOCUMENT_ROOT'].'/downloads/backups/';
header('Content-Type: application/octet-stream');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Content-Disposition: attachment; filename=' . $filename . ';');
header('Content-Length: ' . filesize($filelocation . $filename));
readfile($dir.$file);
}
sendFileToBrowser('Datei.rar')
Dann kann ich die Datei zwar downloaden, aber Sie ist dann immer 0 Bytes groß.