php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13029 Crash when uploading file whose size is > 9 MB
Submitted: 2001-08-29 09:25 UTC Modified: 2001-10-28 17:10 UTC
From: eugenio at pc dot unicatt dot it Assigned:
Status: Closed Package: HTTP related
PHP Version: 4.0.4pl1 OS: Windows 2000 professional
Private report: No CVE-ID: None
 [2001-08-29 09:25 UTC] eugenio at pc dot unicatt dot it
I don't manage to upload file whose size is greater than 9MB, I get a connection aborted error.

I use PHP 4.0.4pl1, Win2000, IIS5 and IE 5.0 or NS 4.77 as browser.

In the php.ini I set memory_limit = 80M, upload_max_filesize= 80M

With small size file all works fine.

This is the script

Form:
<form method="post" action="software_add.php" enctype="multipart/form-data">
	<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="80000000">
	<input type=file name="file_software">
  <input type="submit">
</form>

Software_add.php:
<?
copy($file_software, "$DOCUMENT_ROOT\\software\\$file_software_name");
?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-29 09:37 UTC] sniper@php.net
Are you sure the script isn't getting a timeout?
ie. try putting set_time_limit(0); in beginning of that
script. 

Anyway, the HTTP upload code in PHP is not very suitable
for uploading very big files since it stores everything
in memory before writing it to disk.

(There already is another bug report open about that.)

--Jani

 [2001-08-29 09:49 UTC] eugenio at pc dot unicatt dot it
---
Are you sure the script isn't getting a timeout?
ie. try putting set_time_limit(0); in beginning of that
script. 
---

Yes, it isn't a timeout problem, I've tried both set_time_limit(0) and the same in php.ini; the script crash immediately when I post the file.

I know that the file is stored in memory, but I set memory_limit = 80M so it should work. Why if the size is > 9MB (with a file size of 8MB still works fine) the script crash?


 [2001-08-29 09:49 UTC] eugenio at pc dot unicatt dot it
---
Are you sure the script isn't getting a timeout?
ie. try putting set_time_limit(0); in beginning of that
script. 
---

Yes, it isn't a timeout problem, I've tried both set_time_limit(0) and the same in php.ini; the script crash immediately when I post the file.

I know that the file is stored in memory, but I set memory_limit = 80M so it should work. Why if the size is > 9MB (with a file size of 8MB still works fine) the script crash?


 [2001-08-29 09:51 UTC] sniper@php.net
What is the post_max_size in your php.ini?

 [2001-08-29 09:53 UTC] eugenio at pc dot unicatt dot it
---
Are you sure the script isn't getting a timeout?
ie. try putting set_time_limit(0); in beginning of that
script. 
---

Yes, it isn't a timeout problem, I've tried both set_time_limit(0) and the same in php.ini; the script crash immediately when I post the file.

I know that the file is stored in memory, but I set memory_limit = 80M so it should work. Why if the size is > 9MB (with a file size of 8MB still works fine) the script crash?


 [2001-08-29 09:55 UTC] eugenio at pc dot unicatt dot it
post_max_size is 180M
 [2001-08-29 10:08 UTC] eugenio at pc dot unicatt dot it
post_max_size is 180M
 [2001-08-29 10:09 UTC] eugenio at pc dot unicatt dot it
I don't know mhy my posts are duplicated; i posted them once.
 [2001-08-29 10:18 UTC] eugenio at pc dot unicatt dot it
I don't know mhy my posts are duplicated; i posted them once.
 [2001-08-29 10:28 UTC] eugenio at pc dot unicatt dot it
I don't know mhy my posts are duplicated; i posted them once.
 [2001-10-28 17:10 UTC] sniper@php.net
The http upload support has been rewritten in CVS now.
You can try the latest development build from 
http://www.php4win.com/ 
but make sure it's dated after 27th of October 2001.
(at the moment they don't have any builds there which have
the fix)

Also, there are some minor leaks still in the new code.
If you encounter such leaks, please send the shortest
possible code + html with which you can reproduce the leak
to php-dev@lists.php.net (or me) so we can get rid of these leaks. 

This fix will be in PHP 4.2.0.

--Jani

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 02:01:30 2024 UTC