Forum Moderators: coopster
I have the following script in my site.
$file_dir = "./";
$myFileName="test.txt";
$file = fopen($file_dir.$myFileName,"r");
if (!$file)
{
show_msg("File not open.");
}
else
{
Header("Content-type: application/octet-stream");
Header("Content-Disposition: attachment;
filename=" . $myFileName);
while (!feof ($file))
{
echo fread($file,50000);
}
fclose ($file);
header("Location: http://www.example.com/ok.php");
}
The file can be downloaded successfully, but the problem is the last statement dose not execute.
Anyone can help me?
Thanks very much.