Top Menu
Check file Size Validation on Php
Check file Size Validation on Php

define(“MAX_SIZE”,20000);
$target_path=’fileUpload/’;
if($_FILES[“fileUp”][“size”] < MAX_SIZE){

    if(move_uploaded_file($_FILES[‘fileUp’][‘tmp_name’], $target_path)) {
    echo “The file has been uploaded”;
    } else{
    echo “Error Uploading!”;
    }
}
else{
echo “Large size!”;
}

About The Author

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Close