ID: 28015 Comment by: pieter at frenssen dot be Reported By: kevin_winahradsky at hotmail dot com Status: Open Bug Type: HTTP related Operating System: Linux 2.4.18 PHP Version: 5.0.0RC1 New Comment:
This also happens in PHP 4.3.x, but the bug report has been closed. Check bug #19556. Previous Comments: ------------------------------------------------------------------------ [2004-04-15 20:09:50] kevin_winahradsky at hotmail dot com Description: ------------ When doing an HTTP POST upload of a file, if the upload is canceled by closing the browser, $_FILES['userfile']['error'] will be equal to UPLOAD_ERR_OK. Reproduce code: --------------- <html> <head> </head> <body> <p> <?php if (isset($_FILES['userfile'])) { error_log("error = " . $_FILES['userfile']['error']); error_log("size = " . $_FILES['userfile']['size']); print("<br>" . $_FILES['userfile']['error']); error_log("completed!"); } ?> </p> <p><form enctype="multipart/form-data" action="fileuploadtest.php" method="post"> <input type="hidden" name="MAX_FILE_SIZE" value="50000000"> <input name='userfile' type="file" size="30"> <br> <input type="submit"> </form></p> </body></html> Expected result: ---------------- I would expect $_FILES['userfile']['error'] to be set to UPLOAD_ERR_PARTIAL. Actual result: -------------- $_FILES['userfile']['error'] is set to UPLOAD_ERR_OK. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28015&edit=1