|
|
|
|
@ -1,5 +1,32 @@
|
|
|
|
|
<?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();
|
|
|
|
|
?>
|
|
|
|
|
@ -51,7 +78,7 @@ if(isset($_POST['submit'])){
|
|
|
|
|
?>
|
|
|
|
|
<form method="post" action="" enctype="multipart/form-data">
|
|
|
|
|
<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>
|
|
|
|
|
<ul>
|
|
|
|
|
<li>Supported files: <?= FILELIST; ?></li>
|
|
|
|
|
|