Hello. I use: Header("Content-Type: application/download"); Header("Content-Disposition: attachment; filename=export.txt"); Then after this is done I know that I can write stuff to the file like this: Echo "This will be a line in my file\n"; I am standing in a GUI containing frames. So I want to give an administrator the rights to choose what to export. My problem is that when I include the php file "download.php", the HTML\JAVA code are written to the file. download.php are containing the headers. All the export data are written to the file, but also HTML\JAVA. How can I get around this problem? I would be very happy if someone has a solution. Regards Christian Johansson