php.net |  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
Votes:2
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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
17 + 46 = ?
Subscribe to this entry?

 
 [2004-04-15 20:09 UTC] 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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] sniper@php.net
See bug #19556

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 17:01:30 2024 UTC