php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20696 Large File Upload problem $HTTP_POST_FILES["file_attachment"]["size"]
Submitted: 2002-11-28 05:15 UTC Modified: 2002-11-28 06:26 UTC
From: jason at hodfords dot com Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 4.2.3 OS: Linux Red Hat 7.3
Private report: No CVE-ID: None
 [2002-11-28 05:15 UTC] jason at hodfords dot com
When uploading a large file > 8192K, this problem comes up. 

HTML Page

<form action="testing.php" method="post" enctype="multipart/form-data">
<input type=File name="file_attachment" size=20 value="">
</form>

Testing.php

The variable of $HTTP_POST_FILES["file_attachment"]["size"] will equal 8192K if the uploaded file is greater than 8192K, however the file is say 4000K, then the variable $HTTP_POST_FILES["file_attachment"]["size"] will be equal to 4000K. 

We have made the necessary adjustments to php.ini. 

post_max_size = "14M"
upload_max_filesize = "12M"

We have increased the memory limit to "16M". 

Everything is working fine, except when the file size is greater than 8192K

Thanks, 
Jason.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-28 05:27 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip
 [2002-11-28 05:28 UTC] sniper@php.net
And are you sure that php.ini is really used by PHP?
(check those values from phpinfo() output)

 [2002-11-28 05:35 UTC] jason at hodfords dot com
We will do a phpinfo(); on the very receiving script. 

But a phpinfo(); does show the new values of max_post_size, etc. 

Secondly, before the increased these values in php.ini, the script would not work and it would generate a file of 0 bytes. 

Thanks, 
Jason.
 [2002-11-28 05:50 UTC] sniper@php.net
Please try the snapshot..I can not reproduce this.

 [2002-11-28 06:17 UTC] jason at hodfords dot com
I've isolated the whole situation and I couldn't replicate the problem. 

However, I've found that it's because the filesize is stored to the mysql database and the field is mediumint(9), and when I increased it to BigInt(12), it started working....This is perhaps weird of Mysql....

Sorry to have bothered you. We've got the problem isolated. 

thanks for your time, I hope that we may be able to contribute something to PHP development one day. 

thanks, 
Jason.
 [2002-11-28 06:26 UTC] jan@php.net
bogus then
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 00:01:29 2024 UTC