php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43518 file upload disappears on bigger files than upload_max_filesize
Submitted: 2007-12-06 13:51 UTC Modified: 2008-02-15 17:52 UTC
Votes:5
Avg. Score:4.2 ± 0.4
Reproduced:5 of 5 (100.0%)
Same Version:4 (80.0%)
Same OS:4 (80.0%)
From: info at inprosof dot de Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.2.5 OS: Windows, Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: info at inprosof dot de
New email:
PHP Version: OS:

 

 [2007-12-06 13:51 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-14 20:27 UTC] 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)
 [2008-02-14 20:38 UTC] bjori@php.net
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 21:01 UTC] henning dot lenz at quaerosys dot com
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);
}
?>
 [2008-02-15 17:52 UTC] bjori@php.net
That is because your client (browser) keeps uploading the file.
There is nothing PHP can do about it except ignoring it.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 15 21:01:28 2024 UTC