I have the same problem. I have a download.php file with the above mentioned header-rules. I can download in my xampp-installation without any problems. Once I upload my files to remote machine (hosted webspace) instead of downloading the text file, it will be displayed on screen.
Is there a solution yet?