From 2a4c65726c0d0ab1f893e6aaedda268133a69ac0 Mon Sep 17 00:00:00 2001 From: delcroix Patrick Date: Tue, 11 Sep 2018 22:14:58 +0200 Subject: [PATCH] new: delete zip after download and correct date 2.0 --- htdocs/compta/compta-files.php | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/compta-files.php b/htdocs/compta/compta-files.php index ef8c612ed84..2a4af918234 100644 --- a/htdocs/compta/compta-files.php +++ b/htdocs/compta/compta-files.php @@ -1,5 +1,8 @@ + +/* Copyright (C) 2001-2006 Rodolphe Quiedeville + * Copyright (C) 2004-2017 Laurent Destailleur + * Copyright (C) 2017 Pierre-Henry Favre * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -185,7 +188,7 @@ if(($action=="searchfiles"||$action=="dl" ) && $date_start && $date_stop){ if($result & $action=="dl"){ unset($zip); $log='date,type,ref,total,paid,filename,item_id'."\n"; - $zipname = 'export.zip'; + $zipname = ($date_start)."-".($date_stop).'_export.zip'; $zip = new ZipArchive; $res = $zip->open($zipname, ZipArchive::OVERWRITE|ZipArchive::CREATE); if ($res){ @@ -200,6 +203,7 @@ if($result & $action=="dl"){ header('Content-disposition: attachment; filename='.$zipname); header('Content-Length: ' . filesize($zipname)); readfile($zipname); + unlink($zipname); exit(); } } @@ -285,14 +289,17 @@ if ($result) } print ""; print '
'."\n\t\t\t"; -print ''; -print ''; -print ''; -print ''; -print ''; +print ''; +print ''; +//print ''; +//print ''; +//print ''; +//print ''; +//print ''; +//print ''; print '
'."\n\t\t\n\t\t\n\t\t\t";