How do I verify that a file isn't too big to upload in php before uploading it to the temp folder?
This line:
if ($_FILES['file']['size'] <= 10485760)
will not work because the file gets uploaded to the temp directory first. I already have an Ajax solution that works perfectly. I am trying to code for when scripting is disabled.
According to php.net I can prevent a user from having to wait for a file to upload before receiving an error message stating that it's too big by using this line:
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
but that does not work. All it does it change the maximum file size to 30000.