<form method="post" action="uploadfile.php" enctype="multipart/form-data">
<input type="file" name="file" onchange="this.form.submit()" />
</form>
<!--uploadfile.php-->
<?php
if(!empty($_FILES["file"]["name"])){
if ($_FILES["file"]["error"] > 0){
echo "Error: " . $_FILES["file"]["error"] . "<br>";
die();
}else{
echo "success";
die(); }
}else{ echo "empty file";}
?>
When I run this code and try to upload a file that is too large one server returns 'empty file' which is ok because I can then put some code to deal with this situation however running the exact code, uploading the exact too large file on a different server produces a 500 error. As far as I can see the ini files on bother servers seem to have the same settings. Can anyone tell me why this is and is there a way to stop it. Also why doesn't loading the oversized file trigger the $Files error code?