class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
1. There is a bug in the upload.php demo/test program. It will fail if you try to upload a huge file - like over 8MB. The $_FILE variable is empty, and causes several runtime errors - the first in the call to instantiate the object.
2. So what is with the file size limit thing anyway? My phpinfo() result says there is a 2MB limit, and indeed, a 3MB file will produce the right error. If I try any file between 2MB and 8MB, things work as one would expect (thank god for local development servers to check big files quickly!), but on my configuration (pretty standard Ubuntu server), once the file goes above 8MB, I get an entirely different error. First, the $FILE is empty, and second, there's a runtime warning that the 8MB limit has been exceeded. I don't know where that limit gets set, and why it is different than the 2MB limit reproted by phpinfo().
3. Given that, is there a good JavaScript solution that can check the true filesize limit client side so the user doesn't upload a 2+MB file, and then get the error message?Reply
2. So what is with the file size limit thing anyway? My phpinfo() result says there is a 2MB limit, and indeed, a 3MB file will produce the right error. If I try any file between 2MB and 8MB, things work as one would expect (thank god for local development servers to check big files quickly!), but on my configuration (pretty standard Ubuntu server), once the file goes above 8MB, I get an entirely different error. First, the $FILE is empty, and second, there's a runtime warning that the 8MB limit has been exceeded. I don't know where that limit gets set, and why it is different than the 2MB limit reproted by phpinfo().
3. Given that, is there a good JavaScript solution that can check the true filesize limit client side so the user doesn't upload a 2+MB file, and then get the error message?