summaryrefslogtreecommitdiff
path: root/www/functions/func_download.php
diff options
context:
space:
mode:
authorHorus32014-04-21 18:35:43 +0200
committerHorus32014-04-21 18:35:43 +0200
commitdef084a19a19e1d5c77600c0c0967e5a8fed5b93 (patch)
tree6b8eb4b3af0decc1d0a48dc9304789f2794fd98a /www/functions/func_download.php
parent2a1a332c4e7625a40008d5c4565fca1bbf062d91 (diff)
downloadfiles.iamfabulous.de-def084a19a19e1d5c77600c0c0967e5a8fed5b93.tar.gz
Now you can get a full list of FILES or DIRECTORY from class files. Also changed database layout to log every up- and download.
Diffstat (limited to 'www/functions/func_download.php')
-rw-r--r--www/functions/func_download.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/www/functions/func_download.php b/www/functions/func_download.php
index 26b25b1..576320c 100644
--- a/www/functions/func_download.php
+++ b/www/functions/func_download.php
@@ -103,17 +103,20 @@ function download_file($db, $file_id){
//TODO: buffer output, print if reading == true
header("Content-Type: ".$file_mime);
-
+/*
if(!preg_match("/^image\/.+/", $file_mime)){
header("Content-Disposition: attachment; filename=\"".$file_name."\"");
} else {
header("filename=".$file_name."");
}
+*/
+ header("filename=".$file_name."");
header("Content-Length: ".$file_size);
set_time_limit(0);
$uncompressed_file = readgzfile($gzip_file);
if($uncompressed_file){
+ $db->exec("UPDATE files SET lastseen=(SELECT strftime('%s', 'now')) WHERE id=".SQLite3::escapeString($file_id).";");
return true;
} else {
return false;