Sunday, 18 December 2011

Check file Size Validation on Php

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!";
}

No comments:

Post a Comment