Unixdate2Str(mktime()); $to = $from + 30; $email = $QUERY_STRING; $filename = $email.".ics"; // Get free busy $vfreebusy = $gw->FunctionCall("getpublicvcalendar", $email, $from . "-" . $to); if ($vfreebusy) { // Headers header("Content-Type: application/octet-stream"); header("Content-Disposition: attachment; filename=\"$filename\""); // Print free busy print($vfreebusy); } else { // Not found header("HTTP/1.0 404 Not Found"); } ?>