ID:               43518
 Comment by:       henning dot lenz at quaerosys dot com
 Reported By:      info at inprosof dot de
 Status:           Feedback
 Bug Type:         Unknown/Other Function
 Operating System: Windows, Linux
 PHP Version:      5.2.5
 New Comment:

The following code (consisting mostly of the example from the php docs)
should only allow 300kB files to be uploaded resulting in an
UPLOAD_ERR_FORM_SIZE. If you dismiss the hidden field, it should produce
an UPLOAD_ERR_INI_SIZE. Emergency stop should be after max_input_time.

My Values are:
upload_max_size: 8M
post_max_size: 8M
max_input_time: 60

Reality shows, that a possibly created tmp File stops growing after
reaching upload_max_size and is deleted, but upload continues even after
60s (watch with iptraf or something like this).

<?
print "upload_max_size: ".ini_get("upload_max_filesize")."<br>\n";
print "post_max_size: ".ini_get("post_max_size")."<br>\n";
print "max_input_time: ".ini_get("max_input_time")."<br><br>\n";

print '<form enctype="multipart/form-data"
action="'.$_SERVER['PHP_SELF'].'" method="POST">
    <input type="hidden" name="MAX_FILE_SIZE" value="300000" />
    Send this file: <input name="userfile" type="file" />
    <input type="submit" value="Send File" />
</form>';

if (isset($_FILES["userfile"]))
{
        var_dump($_FILES);
}
?>


Previous Comments:
------------------------------------------------------------------------

[2008-02-14 20:38:35] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.



------------------------------------------------------------------------

[2008-02-14 20:27:42] henning dot lenz at quaerosys dot com

I experience the same/more problems in this way.

File uploads below post_max_size and file_max_size work without any
problems.

If the filesize is bigger than one of them, PHP does not accept the
file, but file uploading continues until the "real" end of the file
regardless of the limit settings (even of input_max_time)

------------------------------------------------------------------------

[2007-12-06 13:51:56] info at inprosof dot de

Description:
------------
-upload_max_filesize and post_max_size in php.ini set to 100M
-file to upload is 140M

- All Array ($_POST, $_GET, $_FILES) are empty after uploading file.
- File does not exist on server.
- No PHP-error or message or notice is requested

Problem: without any file size analysing the script can not generate an
error for the user.

Tested on 
- windows OS 32bit, PHP 5.1.6 and Apache 2.0
- linux OS, PHP 5.2.5, Apache 2.0


Reproduce code:
---------------
please contact me, to send to talk about code.

Expected result:
----------------
We except the file size of the file.

Actual result:
--------------
nothing


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=43518&edit=1

Reply via email to