Hi all,
I'm using the script segment below to allow folks to download html & txt files from my server. Works fine under Opera & Netscape under Linux but on Windows boxes the script name is given instead of the filename - can anyone shed any light as to why ?
$fp=@fopen($pageselected,"r");
header("Content-Type: application/force-download");
header("Content-Length: " .filesize($pageselected));
if(preg_match("/MSIE 5.5/", $HTTP_USER_AGENT)) {
header("Content-Disposition: filename=\"".$pageselected ."\"");
} else {
header("Content-Disposition: attachment; filename=\"".$pageselected ."\"");
}
header("Content-Transfer-Encoding: binary"); fpassthru($fp);
die();