summaryrefslogtreecommitdiff
path: root/www/functions/func_download.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/functions/func_download.php')
-rw-r--r--www/functions/func_download.php12
1 files changed, 7 insertions, 5 deletions
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;
+ //}
}