From: catalin at ips-software dot de
Operating system: Linux (mandrake 9.0)
PHP version: 4.3.1
PHP Bug Type: Unknown/Other Function
Bug description: File Upload Failure
Description:
------------
Trying to upload files which exceed the post_max_size param from
php.ini fails without any errors transmitted to the PHP script that
handles the upload. This is the logged error.
[error] PHP Warning: POST Content-Length of 11184886 bytes exceeds the
limit of 8388608 bytes in Unknown on line 0
I did specify MAX_FILE_SIZE in the HTML form, before the
<Input type=file ... block.
The engine discards the download and gives no error.
The $_FILES and any other server vars are completely empty; no error about
the broken upload.
php.ini:
memory_limit = 48M
post_max_size = 8M
file_uploads = On
upload_max_filesize = 8M
allow_url_fopen = On
Reproduce code:
---------------
<FORM name='up' enctype='multipart/form-data' method='POST' action='<?php
echo $PHP_SELF ?>'>
<INPUT type='hidden' name='MAX_FILE_SIZE' value='5242880' />
<INPUT type='file' name='up_file' size='50' />
<INPUT type='submit' name='submit' />
</FORM>
<?php
if(!empty($submit)) {
print_r($_FILES);
phpinfo();
}
?>
Expected result:
----------------
Since I tryied to upload a file which exceeds both the MAX_FILE_SIZE
and the post_max_size I would have expected to find some sort of error in
the $_FILES['up_file']['error'] or anywhere else in the PHP variables,
but
I found no such error(s).
Actual result:
--------------
No result whatsoever except the log:
[error] PHP Warning: POST Content-Length of 11184886 bytes exceeds the
limit of 8388608 bytes in Unknown on line 0
--
Edit bug report at http://bugs.php.net/?id=24404&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=24404&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=24404&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=24404&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=24404&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=24404&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=24404&r=support
Expected behavior: http://bugs.php.net/fix.php?id=24404&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=24404&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=24404&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=24404&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24404&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=24404&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=24404&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=24404&r=gnused