-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblazeFileDownload.php
More file actions
executable file
·50 lines (36 loc) · 937 Bytes
/
Copy pathblazeFileDownload.php
File metadata and controls
executable file
·50 lines (36 loc) · 937 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
if(extension_loaded('zip')){
$zip = new ZipArchive();
$zip_name = "BlazeApp".time().".zip";
if($zip->open($zip_name, ZIPARCHIVE::CREATE)!==TRUE){
echo '<script>
swal.fire({
title:"Error",
text:"An error occured during download",
icon:"error",
showCancelButton:false,
confirmButtonText:"Try again",
}).then((willProceed)=>{
if(willProceed.isConfirmed){
location.href ="blaze.php";
}else{
location.href ="blaze.php";
}
})
</script>';
die();
}
$file1 = 'download/BLAZE.bat';
$file2 = 'download/Blaze.exe';
$zip->addFile($file1);
$zip->addFile($file2);
$zip->close();
if(file_exists($zip_name)){
#change header content
header('Content-type: application/zip');
header('Content-Disposition: attachment; filename="'.$zip_name.'"');
readfile($zip_name);
unlink($zip_name);
}
}
?>