[SOLVED]Force Download, can't modify header
Posted: Mon Sep 06, 2004 4:43 pm
I am trying to force a download of a .csv file from a form which calls it self. here is the code I am using. Is there no way to modify the header on a page that calls it self? What exactly do I need to do to get this download to go?
here is the error message I receive from IE when I try to execute.
Code: Select all
<?php
$file2 = "orders.csv";
Header ("Content-Type: text/csv");
Header ("Content-Disposition: attachment; filename=$file2");
readfile($file);
?>Warning: Cannot modify header information - headers already sent by (output started at directoryinfo/stats.php:50) in directoryinfo/stats.php on line 509
Warning: Cannot modify header information - headers already sent by (output started at directoryinfo/stats.php:50) in directoryinfo/stats.php on line 510