Hi Daniweb Community,
I'm having a small problem. I am unable to get the size of an uploaded file from the server to run a max size check. When I use the following command as specified in any example of file upload I can find on the web:
if ($_FILES["r_recommend"]["size"] > 500000){
echo "error text";
}else{
move on to upload process
}
This, or any variation thereof, generates no response and the file happily uploads. If the file exceeds the server upload limit, it simply does nothing and returns to upload screen--no error is generated.
A few other things: my input tag does have the both the method="post" and the enctype="multipart/form-data" settings and file uploads are allowed in the php.ini file.
I have worked around this by setting the file upload limit to 25mb--which covers 99% of past uploads, but we would like to make the upload limit smaller to save server space, so I need to figure out a way to generate an error when the user attempts a very large upload.
Your assistance would be greatly appreciated.