Below is the relevant code. On the wamp server it works fine (file downloaded), but on the actual server the content of the file is echoed to the screen (without a specific instruction) but the file is not downloaded. Can somebody help me?
$FileName = $File; //"TestFile.txt";
Print ($FileName);
$len = filesize($File); // Calculate File Size
print ($len);
if(ini_get('zlib.output_compression'))
ini_set('zlib.output_compression', 'Off');
if (file_exists("TestFile.txt"

) {
header('Content-Description: File Transfer');
header('Content-Type: text/txt');
header('Content-Disposition: attachment; filename=TestFile.txt');
header('Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . $len);
ob_clean();
flush();
@readfile("$File"

;
exit;
} else {
echo "no file";
}