php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33730 Super global arrays empty on large file upload
Submitted: 2005-07-16 21:53 UTC Modified: 2005-07-18 02:18 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: stephen dot ball at gmail dot com Assigned:
Status: Not a bug Package: Apache2 related
PHP Version: 4.4.0 OS: Windows XP Professional SP2
Private report: No CVE-ID: None
 [2005-07-16 21:53 UTC] stephen dot ball at gmail dot com
Description:
------------
When selecting a file to upload files which are massively larger than the upload limit cause the super global arrays $_POST, $_GET, $_REQUEST and $_FILES to be empty.

Reproduce code:
---------------
form.html
<form enctype="multipart/form-data" action="upload.php" method="POST">
    <input type="hidden" name="test" value="value" />
    Send this file: <input name="userfile" type="file" />
    <input type="submit" value="Send File" />
</form>

upload.php
<?php
print_r($_POST);
print_r($_REQUEST);

$uploaddir = '/var/www/uploads/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);

echo '<pre>';
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
   echo "File is valid, and was successfully uploaded.\n";
} else {
   echo "Possible file upload attack!\n";
}

print "</pre>";

?> 

Expected result:
----------------
array("test" => "value")
array("test" => "value")
Possible file upload attack! (due to the fact that the file is too large)

Actual result:
--------------
array()
array()
Possible file upload attack!

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-16 22:11 UTC] stephen dot ball at gmail dot com
Files up to 8.2MB work as intended, a file of 8.5MB causes the error.

I don't have any files between those sizes to narrow it down
 [2005-07-18 02:18 UTC] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Of course they do, you're also going over the post_max_size there. No bug.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 09:01:31 2024 UTC