From 08e945b89d649759f40916877f40044657314d9a Mon Sep 17 00:00:00 2001 From: root Date: Fri, 21 Mar 2014 11:56:08 +0100 Subject: If you are loged in, now you can download your files. --- www/functions/func_download.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'www/functions/func_download.php') diff --git a/www/functions/func_download.php b/www/functions/func_download.php index 035e5b4..83db597 100644 --- a/www/functions/func_download.php +++ b/www/functions/func_download.php @@ -2,6 +2,7 @@ /* Expected state: tested, broken. + Works if you are loged in, fatal error if not. */ function start_file_download($user, $path){ @@ -66,15 +67,16 @@ function download_file($db, $file_id){ $uploaddir = "../files/"; $gzip_file = $uploaddir . $file_hash . ".gz"; - $uncompressed_file = readgzfile($gzip_file); - if($uncompressed_file){ + + //if($uncompressed_file){ header("Content-Type: ".$file_mime); header("Content-Disposition: attachment; filename=\"".$file_name."\""); + $uncompressed_file = readgzfile($gzip_file); return true; - } else { - return false; - } + //} else { + // return false; + //} } -- cgit v1.2.3