mirror of
https://github.com/pi-hole/web.git
synced 2026-04-25 03:10:18 +01:00
Add datetimestamp to downloaded filename (e.g. "pi-hole-teleporter_2017-03-05_01-37-52.zip")
This commit is contained in:
@@ -127,7 +127,8 @@ if($_POST["action"] == "in")
|
||||
}
|
||||
else
|
||||
{
|
||||
$archive_file_name = "/var/www/html/pi-hole-teleporter_".microtime(true).".zip";
|
||||
$filename = "pi-hole-teleporter_".date("Y-m-d_h-i-s").".zip";
|
||||
$archive_file_name = "/var/www/html/".$filename;
|
||||
$zip = new ZipArchive();
|
||||
touch($archive_file_name);
|
||||
$res = $zip->open($archive_file_name, ZipArchive::CREATE | ZipArchive::OVERWRITE);
|
||||
@@ -146,7 +147,7 @@ else
|
||||
|
||||
header("Content-type: application/zip");
|
||||
header('Content-Transfer-Encoding: binary');
|
||||
header("Content-Disposition: attachment; filename=pi-hole-teleporter.zip");
|
||||
header("Content-Disposition: attachment; filename=".$filename);
|
||||
header("Content-length: " . filesize($archive_file_name));
|
||||
header("Pragma: no-cache");
|
||||
header("Expires: 0");
|
||||
|
||||
Reference in New Issue
Block a user