<?php
require_once "main.php";
Logger::configure('log4php.xml');
$log = Logger::getLogger('downloaddoc');
$xid = $_GET['xid'];
$log->info($_GET['submitType'].' - user = '.$_SESSION['user'].' - '.$_SESSION['comnum'].' = '.$_GET['id']);
$result = bill_get_doc($_GET['xid']);
$content = $result[0]['content'];
header('Content-length: ' . $result[0]['fsize']);
header('Content-Type: ' . $result[0]['ftype']);
header('Content-Disposition: attachment; filename='.$result[0]['fname'].'');
echo $content;
?>
