Close window after download
Posted: Mon Jul 05, 2004 11:31 am
Hi All,
Here's what I want to do:
A user clicks a link to download some text (from a PHP file)
That PHP file generates the text, and dumps the content. The user is then prompted to download the file.
However, this is where my problem is. After the user has downloaded the file, they're stuck with a big dump blank window in the middle of their screen. Is there any way to get rid of this window?
Here's what I want to do:
A user clicks a link to download some text (from a PHP file)
That PHP file generates the text, and dumps the content. The user is then prompted to download the file.
Code: Select all
<?PHP
header("Content-type: application/octet-stream");
header("Content-disposition: attachment; filename=test.txt");
echo "Contents of file";
?>