Page 1 of 1

[HELP] File Download Problem

Posted: Tue Jul 18, 2006 9:53 pm
by s00263668
Hi all,

Currently i'm create a function to produce excel snapshots. When user click on the link, system will browse Page A. Meanwhile, page A will open a download dialog box and close itself automatically after user start download the file.

In practical, page A doesn't close after user start to download the file. Is there any way to solve this problem?

Posted: Tue Jul 18, 2006 10:37 pm
by Burrito
you can't force a window to close after the download dialogue box is closed or the download has started.

Posted: Wed Jul 19, 2006 12:12 am
by Luke
couldn't you close it with javascript?

window.close()

Posted: Wed Jul 19, 2006 8:58 pm
by s00263668
the problem was solve by using function of header.

Code: Select all

header("Content-type: application/vnd.ms-excel");
	header("Content-Disposition: attachment; filename=$filename" );
	header("Expires: 0");
	header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
	header("Pragma: public");
this code was copied from other people. but i wonder whether META function can provide the same effect?