<?php
mb_parse_str($_SERVER["QUERY_STRING"], $qs);
$fn = array_key_exists('fn', $qs) ? $qs["fn"] : 'download.tgz';
header("Content-type: application/x-gtar");
header("Content-Disposition: attachment; filename=$fn");
system("tar cf - . | gzip");
exit;
?>

