<?
..........
..........//istruzioni precedenti!
..........

header ("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header('Content-Description: File Transfer');
header('Content-Type: application/force-download');
header("Content-Type: ".$type);
header('Content-Length: ' . $size);
header('Content-Disposition: attachment; filename='.$nome);
readfile($file);
?>

Ho usato il readfile con questo codice, il file me lo scarica ma risulta corrotto. In pratica viene incluso nel file anche il codice HTML che sta prima. Come posso evitare questo problema??