Update index.php

pull/8/head
SuperDev 3 years ago committed by GitHub
parent c45af78251
commit 1d928adede
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,32 @@
<?php <?php
require_once(__DIR__ . '/system/core.class.php'); require_once(__DIR__ . '/system/core.class.php');
// size convertor
function sizeFormat($bytes){
$kb = 1024;
$mb = $kb * 1024;
$gb = $mb * 1024;
$tb = $gb * 1024;
if (($bytes >= 0) && ($bytes < $kb)) {
return $bytes . ' B';
} elseif (($bytes >= $kb) && ($bytes < $mb)) {
return ceil($bytes / $kb) . ' KB';
} elseif (($bytes >= $mb) && ($bytes < $gb)) {
return ceil($bytes / $mb) . ' MB';
} elseif (($bytes >= $gb) && ($bytes < $tb)) {
return ceil($bytes / $gb) . ' GB';
} elseif ($bytes >= $tb) {
return ceil($bytes / $tb) . ' TB';
} else {
return $bytes . ' B';
}
}
$maxsize = max_size;
$core = new Core(); $core = new Core();
?> ?>
@ -51,7 +78,7 @@ if(isset($_POST['submit'])){
?> ?>
<form method="post" action="" enctype="multipart/form-data"> <form method="post" action="" enctype="multipart/form-data">
<input type="file" name="fileToUpload"> <input type="file" name="fileToUpload">
<p>Drag your files here or click in this area.</p> <p>Drag your files here or click in this area - <?=sizeConvertor($maxsize)?> Max</p>
<button name="submit" type="submit">Upload</button> <button name="submit" type="submit">Upload</button>
<ul> <ul>
<li>Supported files: <?= FILELIST; ?></li> <li>Supported files: <?= FILELIST; ?></li>

Loading…
Cancel
Save