<?

$types['txt'] = "text/plain";
$types['log'] = "text/plain";
$types['csv'] = "text/plain";
$types['webloc'] = "application/xml";
$types['svg'] = "image/svg+xml";
//$types['rtf'] = "application/rtf";
$types['rtfd'] = "application/rtf";
$types['doc'] = "application/msword";
$types['docx'] = "application/msword";

require "togggle.php";

$zip = new ZipArchive;
$zip->open($_GET['file']);
$stat = $zip->statIndex(0);

if (!$mime = $types[pathinfo($stat['name'],PATHINFO_EXTENSION)]) {
	$mime = "text/plain";
	}

header("Content-Type: ".$mime);
header("Content-Length: ".$stat['size']);
echo $zip->getFromIndex(0);

?>