Hi
can someone tell me why I am not thrown any errors if i upload a file bigger than file size specified in the code. Also it does not throw error if i upload some other extensions instead of images.
if i upload an other file extension instead of images it hangs and any image file which is larger than specified size uploads and does not throw errors.
Please clarify.
$allowedext= array("png", "jpeg", "jpg", "gif");
$ext = explode(".", $_FILES_["file"]["name"]);
$extention=end($ext);
if(( $_FILES["file"]["type"]=="image/png")||($_FILES["file"]["type"]=="image/jpeg")||($_FILES["file"]["type"]== "image/jpg" )||($_FILES["file"]["type"]=="image/gif")&& ($_FILES["file"]["size"]< 2)&& (in_aray($extention,$allowedex)))
{
if (( $_FILES["file"]["error"]>0))
{echo "Error".$_FILES["file"]["error"]."
";
}
else{
move_uploaded_file(($_FILES["file"]["tmp_name"]),"upload/".$_FILES['file']['name']);
echo "Your upload was successful";
}
}
?>