Hi guys i am using the code from w3school php fileupload but when upload some image that bigger than 2000+ kb and come out the error. Upload small size photo works fine.
anyone know whats the problem?
I checked the code and there is file size limit condition but havent reach there and the code is die.
Test or View code here >>> sample
html
<form action="upload.php" method="post" enctype="multipart/form-data">
Select image to upload:
<input type="file" name="fileToUpload" id="fileToUpload">
<input type="submit" value="Upload Image" name="submit">
</form>
php
// Check if image file is a actual image or fake image
if(isset($_POST["submit"])) {
echo "<pre>";
var_export($_FILES['fileToUpload']);
echo "</pre>";
$check = getimagesize($_FILES["fileToUpload"]["tmp_name"]); //get error at here
if($check !== false) {
echo "File is an image - " . $check["mime"] . ".";
$uploadOk = 1;
} else {
echo "File is not an image.";
$uploadOk = 0;
}
}