Location: PHPKode > projects > Adminiature > adminiature-0.0.3rc1/sendfile.php
<?php
session_start();
require_once "impex.class.php";
$fileName=$_GET['file'];
$file="backup/$fileName";
$filelen=filesize($file);
if(strstr($fileName,".gz")) $compress=1; else $compress=0;
header('HTTP/1.1 200 OK');
header('Date: ' . date("D M j G:i:s T Y"));
header('Last-Modified: ' . date("D M j G:i:s T Y"));
if($compress==1) {
header("Content-Type: application/x-gzip");
} else {
header("Content-Type: text/sql");
}
header("Content-Length: " . $filelen);
if($compress==1) {
header("Content-Transfer-Encoding: gzip");
} else {
header("Content-Transfer-Encoding: Ascii");
}
header('Content-Disposition: attachment; filename="'.$file.'"' );
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");

$handle=fopen($file,"r");
while (!feof($handle)) {
        	$buffer = fgets($handle, 4096);
		echo $buffer;
		}
fclose($handle);


?>
Return current item: Adminiature