-
Notifications
You must be signed in to change notification settings - Fork 0
/
view_resume.php
37 lines (32 loc) · 1.14 KB
/
view_resume.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
29
30
31
32
33
34
35
36
37
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Assignment 2 | View Resume</title>
</head>
<body>
</body>
<?php
session_start();
include 'logged_user.php';
if ($_SERVER["REQUEST_METHOD"] == "GET") {
if (isset($_GET["resume"])){
$alumnusToViewResume = htmlspecialchars($_GET["resume"]);
// Load resume from path in storage
$filePath = "resume/".$alumnusToViewResume;
if (file_exists($filePath)) {
// Headers
header('Content-type: application/pdf');
header('Content-Disposition: inline; filename="' . $filePath . '"');
header('Content-Transfer-Encoding: binary');
header('Accept-Ranges: bytes');
// Read PDF file
@readfile($filePath);
} else{
header('Location: main_menu.php');
}
}
}
?>
</html>