From: danny at tibibi dot com Operating system: Windows Server 2008 PHP version: 5.4.4 Package: Unknown/Other Function Bug Type: Bug Bug description:file uploads MAX_FILE_SIZE doesn't work as described
Description: ------------ The documentation for handling file uploads, http://us3.php.net/manual/en/features.file-upload.post-method.php states that when declaring a hidden field named MAX_FILE_SIZE, if the file submitted is larger, then the user will not have to wait longer to be told that the file was too large. <?php if (isset($_POST['MAX_FILE_SIZE'])) { echo $_FILES['file1']['error']; } ?> <html> <body> <form action="/test.php" method="post" enctype="multipart/form-data"> <input type="hidden" name="MAX_FILE_SIZE" value="100" /> <input type="file" name="file1"> <input type="submit" value="submit"> </form> </body> </html> Actual result: -------------- The complete file gets uploaded however big it is, and the result shows: 2 This confirms that MAX_FILE_SIZE worked, and the file was too large, but it did not stop processing the request after 100 bytes were processed. -- Edit bug report at https://bugs.php.net/bug.php?id=62536&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=62536&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=62536&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=62536&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=62536&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=62536&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=62536&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=62536&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=62536&r=needscript Try newer version: https://bugs.php.net/fix.php?id=62536&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=62536&r=support Expected behavior: https://bugs.php.net/fix.php?id=62536&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=62536&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=62536&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=62536&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=62536&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=62536&r=dst IIS Stability: https://bugs.php.net/fix.php?id=62536&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=62536&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=62536&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=62536&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=62536&r=mysqlcfg