-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuploadPaperForm.php
59 lines (53 loc) · 1.79 KB
/
uploadPaperForm.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Upload File | ICIT - 24 | Erode Sengunthar Engineering College</title>
<?php include './includes.php'; ?>
<style>
footer {
position: relative;
}
</style>
</head>
<body>
<?php
include './nav.php';
include './error.php';
?>
<section class="form">
<form method="POST" action="./backend/uploadPaper.php" enctype="multipart/form-data">
<h2>UPLOAD ABSTRACT</h2>
<div class="input-group">
<label for="t_id">Team ID: <span>*</span></label>
<input type="text" name="t_id" id="t_id" placeholder="Enter Team ID" required/>
</div>
<div class="input-group">
<label for="abstract">Upload Abstract: <span>*</span></label>
<input type="file" name="abstract" id="abstract" accept="application/pdf" required />
</div>
<div class="btn-group">
<button type="submit" name="upload">Upload File</button>
</div>
</form>
</section>
<?php include './footer.php'; ?>
<script>
$("#abstract").change(function() {
var file = this.files[0];
var fileType = file.type;
var fileSize = file.size;
var validExtensions = ['application/pdf'];
var maxFileSize = 5242880;
if (validExtensions.indexOf(fileType) == -1) {
alert('Invalid File Type');
this.value = '';
} else if (fileSize > maxFileSize) {
alert('File Size Exceeded');
this.value = '';
}
});
</script>
</body>
</html>