-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdl.php
28 lines (28 loc) · 1.17 KB
/
dl.php
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
<?php
$id = $_GET[id];
$t = $_GET[t];
if($t=="g"){
$type = "groups";
} elseif ($t=="u"){
$type = "users";
} else {
echo "<html><title>Failure!</title><body>Failure of epic proportions has occured. You probably clicked the link after the file had been deleted from our servers. <a href='http://araeosia.com/windperms/'>Click here to try again.</a></body></html>";
}
$fileloc = "/var/www/araeosia/windperms/output/" . $id . "." . $type . ".yml";
if (file_exists($fileloc)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=' . $type . '.yml');
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($fileloc));
ob_clean();
flush();
readfile($fileloc);
exit;
} else {
echo "<html><title>Failure!</title><body>Failure of epic proportions has occured. You probably clicked the link after the file had been deleted from our servers. <a href='http://araeosia.com/windperms/'>Click here to try again.</a></body></html>";
}
?>