Code: Select all
$tempdest="/var/www/html/sysrep/reports/$date/$system/$customer/$report";
if (file_exists($tempdest))
{
$expanded = implode("",@gzfile($tempdest));
$firstpagebreak=strpos($expanded,chr(12));
$expanded = substr($expanded,$firstpagebreak+1);
$expanded = str_replace("\n","\n\\par ",$expanded);
$expanded = str_replace(chr(12),"\\page ",$expanded);
header("Content-Descrption: File Transfer");
header("Content-Type: application/force-download");
header("Content-Length: ". strlen($expanded));
header("Content-Disposition: attachment; filename=\"".$_GET["report"].".rtf\"");
readfile("rtfhead.inc");
echo $expanded;
readfile("rtffoot.inc");
}else{
echo "I have no reports for the information provided. Please try again.<br>\n";
}
exit;
?>
Any help is greatly appreciated. I exhausted Google with every possible combination of terms I could think of to figure this out.