Hello,
Wondering if anyone can help.
I have a browse facility on a form.
<input name="ufile[]" type="file" id="ufile[]" />
And when I hit submit, I save the file to a folder on the server and the path in the database which works great, but I also want to check the image uploaded is less than 2mb? Can anyone see where i'm going wrong as it just uploads the file nomatter the size:
<?
if (isset($_POST['Submit'])) {
$picunique = md5(uniqid()); // Unique filename for picture
$picture = "/home/**************/httpdocs/$picunique".$_FILES['ufile']['name'][0];
// Copy file to where I want to store file
move_uploaded_file ($_FILES['ufile']['tmp_name'][0], $picture);
//Set themax file size as 2mb
$byte="2097152";
// Check for Required Fields with IF statements
if($_FILES> $byte){
echo 'Your file is too big';
}
?>
Thanks