By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,741 Members | 2,009 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,741 IT Pros & Developers. It's quick & easy.

input element of type file not reading file names after 20 file elements

Coldfire
100+
P: 289
Hi,

The strange problem i am having is,

the input element of type='file' not reading file names after 20 file elements. It simple returns null on reading the 'name' of file.

The code is simple and has no error as I am testing it standalone

Expand|Select|Wrap|Line Numbers
  1.  
  2. <form action="testfile.php"  method="post"
  3. enctype="multipart/form-data">
  4. 1<input type="file" name="userfile1" id="userfile1"  size="13"/>
  5. 2<input type="file" name="userfile2" id="userfile2"  size="13"/>
  6. 3<input type="file" name="userfile3" id="userfile3"  size="13"/>
  7. 4<input type="file" name="userfile4" id="userfile4"  size="13"/><br/>
  8. 5<input type="file" name="userfile5" id="userfile5"  size="13"/>
  9. 6<input type="file" name="userfile6" id="userfile6"  size="13"/>
  10. 7<input type="file" name="userfile7" id="userfile7"  size="13"/>
  11. 8<input type="file" name="userfile8" id="userfile8"  size="13"/><br/>
  12. 9<input type="file" name="userfile9" id="userfile9"  size="13"/>
  13. 10<input type="file" name="userfile10" id="userfile10"  size="13"/>
  14. 11<input type="file" name="userfile11" id="userfile11"  size="13"/>
  15. 12<input type="file" name="userfile12" id="userfile12"  size="13"/><br/>
  16. 13<input type="file" name="userfile13" id="userfile13"  size="13"/>
  17. 14<input type="file" name="userfile14" id="userfile14"  size="13"/>
  18. 15<input type="file" name="userfile15" id="userfile15"  size="13"/>
  19. 16<input type="file" name="userfile16" id="userfile16"  size="13"/><br/>
  20. 17<input type="file" name="userfile17" id="userfile17"  size="13"/>
  21. 18<input type="file" name="userfile18" id="userfile18"  size="13"/>
  22. 19<input type="file" name="userfile19" id="userfile19"  size="13"/>
  23. 20<input type="file" name="userfile20" id="userfile20"  size="13"/><br/>
  24. 21<input type="file" name="userfile21" id="userfile21"  size="13"/>
  25. 22<input type="file" name="userfile22" id="userfile22"  size="13"/>
  26. 23<input type="file" name="userfile23" id="userfile23"  size="13"/>
  27. 24<input type="file" name="userfile24" id="userfile24"  size="13"/>
  28. <input type="submit" name="submit" value="Submit" />
  29. </form>
  30.  
  31.  
On Submit Button, the following code is executed in testfile.php

Expand|Select|Wrap|Line Numbers
  1. for($i=1;$i<=24;$i++){
  2.  
  3. echo "File to Upload: " . $_FILES["userfile".$i]["name"] . "<br />";
  4. }
Is this related to php5.ini configurations. But its settings related to file are

Expand|Select|Wrap|Line Numbers
  1. engine = On
  2. file_uploads = On
  3. upload_max_filesize = 1M
  4. post_max_size = 180M
  5. max_execution_time = 80
  6. allow_url_fopen = On
  7. user_agent="PHP"
  8. default_socket_timeout = 60

Any suggestions ?
Jun 11 '10 #1
Share this Question
Share on Google+
1 Reply


Coldfire
100+
P: 289
OK ignorant me.

"max_file_uploads" parameter controls the number of files you can upload. Changed its value in php5.ini file
Jun 11 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.