mirror of
https://github.com/Supernova3339/anonupload.git
synced 2026-04-13 23:37:32 +02:00
Update index.php
This commit is contained in:
76
index.php
76
index.php
@@ -42,7 +42,81 @@ $core = new Core();
|
||||
<?php if(app_name&&app_desc == null){ ?>
|
||||
AnonUpload - Secure and anonymous file sharing <?php } if(app_name&&app_desc == !null){ echo app_name . ' - ' . app_desc; } ?></title>
|
||||
<!-- for discord -->
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:type" content="website"><?php
|
||||
require_once(__DIR__ . '/system/core.class.php');
|
||||
|
||||
$core = new Core();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title><?= app_name; ?> - <?= app_desc; ?></title>
|
||||
<link rel="stylesheet" type="text/css" href="assets/main.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrapper">
|
||||
<img src="assets/images/logo.png">
|
||||
<?php
|
||||
if(isset($_POST['submit'])){
|
||||
if($core->FileTypeVerification($_FILES["fileToUpload"])){
|
||||
if($core->FileSizeVerification($_FILES["fileToUpload"])){
|
||||
$newfilename = $core->FileNameConvertor($_FILES["fileToUpload"]);
|
||||
if($core->UploadFile($_FILES["fileToUpload"], $newfilename)){
|
||||
?>
|
||||
<div class="notification success">
|
||||
Success ! Your file are available here: <a href="<?= file_url_destination.'/'.file_destination.'/'.$newfilename; ?>"><?= file_url_destination.'/'.file_destination.'/'.$newfilename; ?></a>
|
||||
</div>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<div class="notification error">
|
||||
An error occured while trying to upload your file(s).
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}else{
|
||||
?>
|
||||
<div class="notification error">
|
||||
Your file is too high/low.
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}else{
|
||||
?>
|
||||
<div class="notification error">
|
||||
Incorrect file format.
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<form method="post" action="" enctype="multipart/form-data">
|
||||
<input type="file" name="fileToUpload">
|
||||
<p>Drag your files here or click in this area.</p>
|
||||
<button name="submit" type="submit">Upload</button>
|
||||
<ul>
|
||||
<li>Supported files: <?= FILELIST; ?></li>
|
||||
</ul>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$('form input').change(function () {
|
||||
if(this.files.length == 0){}else{
|
||||
$('form p').text("File selected: "+this.files[0].name);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
<meta property="og:title" content="<?= app_name; ?>" />
|
||||
<meta property="og:description" content="<?= app_desc; ?>" />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user