|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-10-07 11:48 UTC] pieter at frenssen dot be
[2005-01-10 15:18 UTC] sniper@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 21:00:01 2025 UTC |
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.