|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28015 HTTP POST file uploads do not give error when canceled
Submitted: 2004-04-15 20:09 UTC Modified: 2005-01-10 15:18 UTC
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: kevin_winahradsky at hotmail dot com Assigned:
Status: Not a bug Package: HTTP related
PHP Version: 5.0.0RC1 OS: Linux 2.4.18
Private report: No CVE-ID: None
 [2004-04-15 20:09 UTC] kevin_winahradsky at hotmail dot com
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>

if (isset($_FILES['userfile'])) {
    error_log("error = " . $_FILES['userfile']['error']);
    error_log("size = " . $_FILES['userfile']['size']);
    print("<br>" . $_FILES['userfile']['error']);

<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">


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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-07 11:48 UTC] pieter at frenssen dot be
This also happens in PHP 4.3.x, but the bug report has been closed. Check bug #19556.
 [2005-01-10 15:18 UTC]
See bug #19556

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 21 10:01:30 2024 UTC