|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-07-26 19:06 UTC] djwang at manze dot com
Description:
------------
when I run the test script under windows (win2003+iis+php or win2003+apache+php), the $_FILES array will not return more than 20 elements, but it return 30 elements under FreeBSD.
Test script:
---------------
<? print_r($_FILES);?>
<form action="t.php" method="post" enctype="multipart/form-data">
1<input type="file" name="abc[]">2<input type="file" name="abc[]">
3<input type="file" name="abc[]">4<input type="file" name="abc[]">
5<input type="file" name="abc[]">6<input type="file" name="abc[]">
7<input type="file" name="abc[]">8<input type="file" name="abc[]">
9<input type="file" name="abc[]">10<input type="file" name="abc[]">
11<input type="file" name="abc[]">12<input type="file" name="abc[]">
13<input type="file" name="abc[]">14<input type="file" name="abc[]">
15<input type="file" name="abc[]">16<input type="file" name="abc[]">
17<input type="file" name="abc[]">18<input type="file" name="abc[]">
19<input type="file" name="abc[]">20<input type="file" name="abc[]">
21<input type="file" name="abc[]">22<input type="file" name="abc[]">
23<input type="file" name="abc[]">24<input type="file" name="abc[]">
25<input type="file" name="abc[]">26<input type="file" name="abc[]">
27<input type="file" name="abc[]">28<input type="file" name="abc[]">
29<input type="file" name="abc[]">30<input type="file" name="abc[]">
<input type="submit">
</form>
Expected result:
----------------
under FreeBSD+apache+php the test code will return $_FILES array with 30 elements like this:
Array
(
[abc] => Array
(
[name] => Array
(
[0] =>
[1] =>
[2] =>
[3] =>
[4] =>
[5] =>
[6] =>
[7] =>
[8] =>
[9] =>
[10] =>
[11] =>
[12] =>
[13] =>
[14] =>
[15] =>
[16] =>
[17] =>
[18] =>
[19] =>
[20] =>
[21] =>
[22] =>
[23] =>
[24] =>
[25] =>
[26] =>
[27] =>
[28] =>
[29] =>
)
[type] => Array
(
[0] =>
[1] =>
[2] =>
[3] =>
[4] =>
[5] =>
[6] =>
[7] =>
[8] =>
[9] =>
[10] =>
[11] =>
[12] =>
[13] =>
[14] =>
[15] =>
[16] =>
[17] =>
[18] =>
[19] =>
[20] =>
[21] =>
[22] =>
[23] =>
[24] =>
[25] =>
[26] =>
[27] =>
[28] =>
[29] =>
)
[tmp_name] => Array
(
[0] =>
[1] =>
[2] =>
[3] =>
[4] =>
[5] =>
[6] =>
[7] =>
[8] =>
[9] =>
[10] =>
[11] =>
[12] =>
[13] =>
[14] =>
[15] =>
[16] =>
[17] =>
[18] =>
[19] =>
[20] =>
[21] =>
[22] =>
[23] =>
[24] =>
[25] =>
[26] =>
[27] =>
[28] =>
[29] =>
)
[error] => Array
(
[0] => 4
[1] => 4
[2] => 4
[3] => 4
[4] => 4
[5] => 4
[6] => 4
[7] => 4
[8] => 4
[9] => 4
[10] => 4
[11] => 4
[12] => 4
[13] => 4
[14] => 4
[15] => 4
[16] => 4
[17] => 4
[18] => 4
[19] => 4
[20] => 4
[21] => 4
[22] => 4
[23] => 4
[24] => 4
[25] => 4
[26] => 4
[27] => 4
[28] => 4
[29] => 4
)
[size] => Array
(
[0] => 0
[1] => 0
[2] => 0
[3] => 0
[4] => 0
[5] => 0
[6] => 0
[7] => 0
[8] => 0
[9] => 0
[10] => 0
[11] => 0
[12] => 0
[13] => 0
[14] => 0
[15] => 0
[16] => 0
[17] => 0
[18] => 0
[19] => 0
[20] => 0
[21] => 0
[22] => 0
[23] => 0
[24] => 0
[25] => 0
[26] => 0
[27] => 0
[28] => 0
[29] => 0
)
)
)
Actual result:
--------------
but under windows 2003, I can't upload more than 20 files. the $_FILES array will only have 20 elements like:
Array
(
[abc] => Array
(
[name] => Array
(
[0] =>
[1] =>
[2] =>
[3] =>
[4] =>
[5] =>
[6] =>
[7] =>
[8] =>
[9] =>
[10] =>
[11] =>
[12] =>
[13] =>
[14] =>
[15] =>
[16] =>
[17] =>
[18] =>
[19] =>
)
[type] => Array
(
[0] =>
[1] =>
[2] =>
[3] =>
[4] =>
[5] =>
[6] =>
[7] =>
[8] =>
[9] =>
[10] =>
[11] =>
[12] =>
[13] =>
[14] =>
[15] =>
[16] =>
[17] =>
[18] =>
[19] =>
)
[tmp_name] => Array
(
[0] =>
[1] =>
[2] =>
[3] =>
[4] =>
[5] =>
[6] =>
[7] =>
[8] =>
[9] =>
[10] =>
[11] =>
[12] =>
[13] =>
[14] =>
[15] =>
[16] =>
[17] =>
[18] =>
[19] =>
)
[error] => Array
(
[0] => 4
[1] => 4
[2] => 4
[3] => 4
[4] => 4
[5] => 4
[6] => 4
[7] => 4
[8] => 4
[9] => 4
[10] => 4
[11] => 4
[12] => 4
[13] => 4
[14] => 4
[15] => 4
[16] => 4
[17] => 4
[18] => 4
[19] => 4
)
[size] => Array
(
[0] => 0
[1] => 0
[2] => 0
[3] => 0
[4] => 0
[5] => 0
[6] => 0
[7] => 0
[8] => 0
[9] => 0
[10] => 0
[11] => 0
[12] => 0
[13] => 0
[14] => 0
[15] => 0
[16] => 0
[17] => 0
[18] => 0
[19] => 0
)
)
)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 16:00:01 2025 UTC |
I have updated the test script as follow: ------------------------------ <?php echo sizeof($_FILES[abc][name]); //echo how many file elements in $_FILE array. ?> <form action="<?=$_SERVER[PHP_SELF]?>" method="post" enctype="multipart/form-data"> <?php for($i=1;$i<=30;$i++){ //create a form contain 30 file upload fields. echo $i."-<input type=\"file\" name=\"abc[]\"><br />"; } ?> <input type="submit"> </form> Expected result: ---------------- If I put the test script under Freebsd or Linux(Apache+PHP) and submit the form, it will return: 30 Actual result: -------------- When I put this test script under windows system(win2003+iis+php or win2003+apache+php) and submit the form, it will return: 20 So when I upload more than 20 files in same time , my script which run on Windows will only get 20 files and lost others.