Ok I have an image upload that works great and checks for an existing file and file types. I have recently added a error check that makes sure the file size is below 1.4 mb
The problem I have is its not works. So for error checking purposes I have made the script just show me the file size on a new page and do nothing else. Here it is
if (isset($_POST['Save_photo'])) {
//another photo uploader
$fileName1 = trim($_FILES['new_photo']['name']);
$tmpName = $_FILES['new_photo']['tmp_name'];
$fileSize = $_FILES['new_photo']['size'];
$fileType = $_FILES['new_photo']['type'];
$randName = md5(rand() * time());
$fileName = $randName.$fileName1;
print $fileSize; exit();
}
Now here is my issue. If I upload a file of say about 730KB it echos
756305
If I upload a file over 1.2MB or more it echos
I dont understand why. There is no other code on the page at the moment! Im quite new to php so I dont know any other ways to sort this out. Please help.
Thank you