Welcome aboard! We are happy you are here and wish you good net-raft!
<!DOCTYPE html>
<html>
<body>
<form action="<?php echo $_SERVER['PHP_SELF'];?>" id ="upl1" method="POST" enctype="multipart/form-data">
<input type="file" id="html_btn1" name="html_btn1"></p>
<button type="submit" form="upl1" value="Submit">Submit</button>
</form>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
// Check file size 300 Bytes
if ($_FILES["html_btn1"]["size"] > 300) {
echo "Sorry, your file is too large.";
}
else
{
echo "ok";
}
}
?>
</body>
</html>
The most helpful PHP solutions
detect browser phpPHP Click to see more ... 4.6K 408