-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdonwload-certificate.php
More file actions
29 lines (29 loc) · 927 Bytes
/
donwload-certificate.php
File metadata and controls
29 lines (29 loc) · 927 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
<?php
if (isset($_GET['l']) & isset($_GET['e']) ) {
$filename = $_GET['l'];
$back_file = $_GET['e'];
$back_dir ="asset/tsps/";
$file = $back_dir.$back_file."/".$filename;
// echo "$file";
// die;
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: private');
header('Pragma: private');
header('Content-Length: ' . filesize($file));
ob_clean();
flush();
readfile($file);
header("location:sertifikat.php");
exit;
}
else {
// $_SESSION['pesan'] = "Oops! File - $filename - not found ...";
header("location:sertifikat.php");
}
}
?>