$dir="files/"; if (isset($_REQUEST["file"]) and file_exists($dir.$_REQUEST["file"])) { $file=$_REQUEST["file"]; session_start(); if (isset($_SESSION['viewLicense']) and $_GET["accept"]) { // download the file session_destroy(); // trace into local file $data = date("d/m/Y H:i:s")." ".$_SERVER['REMOTE_ADDR']." ".$file."\n"; $fh = fopen('stats/downloads','a'); fwrite($fh,$data); fclose($fh); header("Content-type: application/octet-stream"); header("Content-Transfer-Encoding: Binary"); header("Content-length: ".filesize($dir.$file)); header("Content-disposition: attachment; filename=\"".basename($file)."\""); readfile("$dir$file"); } else { // print license $message = ""; if (isset($_SESSION['viewLicense'])) { $message = "To download TPYE you must accept the license terms"; } $_SESSION["viewLicense"] = 1; ?>
If you cannot read the license above, you can download it here.