Force download and close window
Posted: Fri Nov 17, 2006 11:01 am
Here is the code snipet i use to force download. After the save download pops up IE closes the window but Firefox does not. How can i make firefox close the window?
TIA!
Code: Select all
header('Content-Type: text/comma-separated-values');
if (strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE')){
header('Content-Disposition: inline; filename="'.$rpt->report_type.'.csv"');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
} else {
header('Content-Disposition: attachment; filename="'.$rpt->report_type.'.csv"');
header('Pragma: no-cache');
}//end if