#31764 [Opn->Fbk]: Apache hangs during file upload when using "MAX_FILE_SIZE"
ID: 31764
Updated by: sniper@php.net
Reported By: t dot schoebel at hamburg dot de
-Status: Open
+Status: Feedback
Bug Type: HTTP related
Operating System: Debian 3.0 Woody
PHP Version: 4.3.10
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2005-01-30 12:57:17] t dot schoebel at hamburg dot de
Description:
------------
I'm hosting a costumer, who uses an old script written for php 3.x.
If at the same time some visitors uploads an image, apache "crashed".
The load average jumps to 50 > an there is no possible to connect to
the server via ssh anymore.
In the error.log i get i.e. the following messages:
[Sat Jan 29 01:35:30 2005] [warn] child process 24784 still did not
exit, sending a SIGTERM
Reproduce code:
---------------
<form ENCTYPE="multipart/form-data" name=info method=post
ACTION="page.upload.php">
<table>
<tr>
<td>Datei:</td>
<td> <INPUT TYPE="hidden" name="MAX_FILE_SIZE"
value="100000"><input
name="userfile" type="file" <? echo $styleform3; ?>>
<INPUT TYPE="hidden" NAME="code" value="1"><br>
<INPUT TYPE="hidden" NAME="user" value="<? echo
$user;?>"></td>
</tr>
...
if (is_uploaded_file ($userfile)){
$dir = "/var/kunden/webs/web1/tmp/";
move_uploaded_file($userfile,$dir.$userfile_name) ;
}
Expected result:
----------------
When I upload an image, which is more than 100000 bytes big, cause of
the html-code <INPUT TYPE="hidden" name="MAX_FILE_SIZE"
value="100000">
it's given, i get an php error, that the script gets no data.
Apache breaks the transfer to php, cause the image is bigger then
100000 bytes.
Actual result:
--------------
If you delete the hmtl-tag <INPUT TYPE="hidden" name="MAX_FILE_SIZE"
value="100000"> an add in your script a check, written in php, for the
size and may be the type of the file, you won't get an apache "crash".
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31764&edit=1
Thread (4 messages)