I'm writing a page to download a list of email addresses which are stored in a database to a text file.
From the archives I've figured out how to get IE and Netscape to properly download the file. However the file contains an extra set of newlines (\n\n) at the top of the file before my output (verified w/ od). This of course confuses apps like notepad that our clients might be using to access the downloaded data.
I've tried switching the content-type header to application/download, text/plain, text/x-plain without changing the results.
How do I prevent the extra newlines from appearing?
Thanks,
David
<?
Header("Content-Disposition: attachment; filename=address.txt");
Header("Content-type: application/octet-stream");
... get data from database ...
for ($Row = 0; $Row < $LenAddressList; $Row++) {
echo $AddressList['ADDRESS'][$Row] . "\r\n";
}
?>