-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathupload.php
More file actions
133 lines (122 loc) · 3.84 KB
/
upload.php
File metadata and controls
133 lines (122 loc) · 3.84 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<?php
include "configuration/config.php";
include "classes/Database.php";
include "classes/Upload.php";
include "classes/UploadHandler.php";
use BlackUpload\Upload;
$upload = new Upload;
$handler = new UploadHandler;
$upload->setINI(
[
"file_uploads" => 1,
"display_errors" => 1,
"log_errors" => 1,
"error_log" => "error_logs/php_scripts_error.log",
"upload_max_filesize" => "2000M",
"max_file_uploads" => "10",
"post_max_size" => "2500M",
"max_input_time" => "60",
"memory_limit" => "500M",
"max_execution_time" => "60",
]
);
$upload->setController("classes/");
if ($_SERVER['REQUEST_METHOD'] == "POST") {
$inputs = $upload->fix_array($_FILES['file']);
if (count($inputs) > 10) {
header('Location: index.php?error=1');
exit;
}
foreach ($inputs as $file) {
if ($upload->factory($file)) {
$handler->add_file($upload->getFileID(), $upload->getUserID(), $upload->getJSON());
}
}
}
$resp = $upload->getLogs();
$files = $upload->get_files()
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title><?php echo $config['website_name'] ?> - Your Files</title>
<?php include_once 'components/header.php'?>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<a class="navbar-brand" href="#"><?php echo $config['website_name'] ?></a>
<button
class="navbar-toggler"
type="button"
data-toggle="collapse"
data-target="#navbarColor01"
aria-controls="navbarColor01"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarColor01">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="index.php"
><span class="fa fa-home"></span> Home</a
>
</li>
<li class="nav-item">
<a class="nav-link" href="terms.php"
><span class="fa fa-file-text"></span> Terms of Services</a
>
</li>
<li class="nav-item">
<a class="nav-link" href="about.php"
><span class="fa fa-user"></span> About Us</a
>
</li>
<li class="nav-item">
<a class="nav-link" href="report.php"
><span class="fa fa-flag"></span> Report Abuse</a
>
</li>
</ul>
</div>
</nav>
<div class="container pb-5 pt-5">
<div class="row justify-content-center text-center">
<div class="col-sm-12 col-md-9 col-lg-9">
<div class="card">
<div class="card-header">
Your Uploaded Files
</div>
<div class="card-body">
<h4 class="card-title">Your Files</h4>
<hr />
<div class="container">
<?php foreach ($files as $file): ?>
<div class="alert alert-success mb-1 mt-3">
<b><?php echo $file->filename . " : " . $upload->getMessage($file->message) ?></b>
</div>
<?php echo $file->filename; ?>
<br />
<a
class="btn btn-primary"
href="<?php echo $file->downloadurl ?>"
>Click Here to Download</a
>
<a
class="btn btn-danger"
href="<?php echo $file->deletelink ?>"
>Click Here to Delete</a
>
<?php endforeach;?>
</div>
</div>
</div>
</div>
</div>
</div>
<?php include_once 'components/ads.php'?>
<?php include_once 'components/footer.php'?>
</body>
</html>