php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49570 $_POST is empty with large file uploads
Submitted: 2009-09-16 13:48 UTC Modified: 2009-10-01 01:00 UTC
Votes:9
Avg. Score:4.2 ± 0.9
Reproduced:7 of 7 (100.0%)
Same Version:3 (42.9%)
Same OS:0 (0.0%)
From: erikvernsmith at yahoo dot com Assigned:
Status: No Feedback Package: Filesystem function related
PHP Version: 5.3.0 OS: Mac OS 10.6.1
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: erikvernsmith at yahoo dot com
New email:
PHP Version: OS:

 

 [2009-09-16 13:48 UTC] erikvernsmith at yahoo dot com
Description:
------------
I set upload_max_filesize in php.ini to 64M

I'm using a simple html form to post/upload a file to a simple php script. If I upload files smaller than 8MB everything works fine. If I upload a file larger than 8MB, print_r( $_POST ) and print_r( $_FILES ) are empty.

Important note: 8MB is not a magic number. On my localhost 10MB files do upload, but 50MB files do not. 8MB files will not work on my remote website, but 7MB files will work.



Reproduce code:
---------------
complete HTML file:

<form enctype="multipart/form-data" action="simpleuploadtest.php" method="POST">
<input type="text" name="mytitle" value="junkjunk and more junk" />
Choose a file to upload: <input name="uploadedfile" value="" type="file" /><br />
<input type="submit" value="Upload File" />
</form>


complete PHP file:

<?php
echo 'testing123<BR><BR>';
echo $_POST['mytitle'];
echo '<BR><BR>';
print_r( $_POST );
echo '<BR><BR>';
print_r( $_FILES );
?>


Expected result:
----------------
I expect the $_POST and $_FILES arrays to have contents, like this:

testing123

junkjunk and more junk

Array ( [mytitle] => junkjunk and more junk )

Array ( [uploadedfile] => Array ( [name] => junk.bin [type] => application/macbinary [tmp_name] => /private/var/tmp/php0tupN2 [error] => 0 [size] => 10485760 ) ) 

Actual result:
--------------
The $_POST and $_FILES arrays are empty, like this:

testing123



Array ( )

Array ( ) 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-23 15:56 UTC] sjoerd@php.net
Thank you for your bug report.

To properly diagnose the problem, we need some more information from you. Have you enabled error reporting? Do you get any errors in the error log? Could the script stop because the max execution time expires? How long does it take for the script to stop? Does the script works fine other than that $_POST and $_FILES are empty?
 [2009-10-01 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2009-12-07 13:12 UTC] erikvernsmith at yahoo dot com
Have you enabled error reporting? 
Yes.

Do you get any errors in the error log? 
I only get one error, Undefined index: mytitle in myfile.php on line 3

Could the script stop because the max execution time expires?
No, the max execution time is set to 60 seconds in php.ini

How long does it take for the script to stop?
The script is running on localhost and appears to be almost 
instantaneous.

Does the script works fine other than that $_POST and $_FILES are 
empty?
Yes

Further information:
I have now upgraded to Mac OS 10.6.2, Apache 2.2.14 and PHP 5.3.1 and 
I am still experiencing this problem.
 [2010-03-25 19:28 UTC] erikvernsmith at yahoo dot com
Check ALL of these settings in php.ini
file_uploads
upload_max_filesize
max_input_time
memory_limit
max_execution_time
post_max_size
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Nov 16 21:01:32 2019 UTC