-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
45 lines (42 loc) · 1.69 KB
/
index.html
File metadata and controls
45 lines (42 loc) · 1.69 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PDF Summarizer</title>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
</head>
<body>
<div class="container">
<h1 class="title">Upload PDF for Summarization</h1>
<form action="/upload" method="post" enctype="multipart/form-data" onsubmit="return validateForm()">
<label for="file-upload" class="custom-file-upload">
<i class="fas fa-cloud-upload-alt"></i> Choose PDF
</label>
<input id="file-upload" type="file" name="file" accept=".pdf" required onchange="showFileName()">
<span id="file-name" class="file-name">No file chosen</span>
<button type="submit">Upload</button>
</form>
</div>
<div class="d-flex flex-column justify-content-center w-100 h-100">
<div class="d-flex flex-column justify-content-center align-items-center">
</div>
</div>
</div>
<script>
function showFileName() {
var input = document.getElementById('file-upload');
var fileNameSpan = document.getElementById('file-name');
fileNameSpan.textContent = input.files[0] ? input.files[0].name : 'No file chosen';
}
function validateForm() {
var input = document.getElementById('file-upload');
if (!input.files || !input.files[0]) {
alert("Please choose a PDF file to upload.");
return false;
}
return true;
}
</script>
</body>
</html>