php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27844 $_POST and $_FILES empty when upload_max_size exceeded
Submitted: 2004-04-02 13:32 UTC Modified: 2004-04-09 15:44 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: marco at opus dot ch Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.3.6RC1 OS: Windows 2000
Private report: No CVE-ID: None
 [2004-04-02 13:32 UTC] marco at opus dot ch
Description:
------------
I've got a form which uploads a file along with other information (including and ID that identifies location in the site). When I upload a file that exceeds the size limits, I get no $_FILES and no $_POST information. That means if the user chooses a large file, they are redirected to a 'not allowed to do that here' page instead of a form error, because the ID is missing and their request can't be validated.

This bug has been documented in the user comments in the documentation, but is still in the latest release:

http://php.planetmirror.com/manual/en/features.file-upload.common-pitfalls.php


Reproduce code:
---------------
<html>
<body>
<form action="test.html" enctype="multipart/form-data" method="post">
<input type="hidden" name="SID" value="XXX"
<input type="file" name="test">
<input type="submit">
</form>
</html>

<?php

print_r( $_REQUEST );

?>



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-04 13:57 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

The _REQEUST super-global does not include the data from 
$_FILES. 
 
If you print the $_FILES array you will see it contains the 
file entry with an error indicator. The $_POST and 
$_REQUEST both have the regular post fields filled in. 
 [2004-04-09 15:44 UTC] marco at opus dot ch
Yeah, it looks to be bogus ... the code I posted wasn't exactly the sample I was using. As mentioned, it wasn't just the request that was entirely empty, but also the post and files variables. I am no longer able to replicate it though ... seems to be working as advertised. Sorry to trouble you.
 [2004-07-11 15:40 UTC] snoj at equipesuissedubedo dot com
Hi,

when working with uploaded files that are smaller than 'upload_max_filesize' this works fine, but $_REQUEST is empty if the uploaded file is bigger than 'uploaded_max_filesize'.

code:
---------------------------------------------------------
<html>
<body>
<form action="newup.php" enctype="multipart/form-data" method="post">
<input type="hidden" name="SID" value="XXX">
<input type="file" name="test">
<input type="submit">
</form>
</html>

<?php

print_r( $_REQUEST );

?>
---------------------------------------------------------

PHP 4.3.3
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 08:01:27 2024 UTC