PHP 4.0 Bug #4969: Multiple File Upload work INCORRECT !!!

From: Date: Mon, 12 Jun 2000 03:00:32 +0000
Subject: PHP 4.0 Bug #4969: Multiple File Upload work INCORRECT !!!
Groups: php.dev 
Request: Send a blank email to php-dev+get-21071@lists.php.net to get a copy of this message
From: fith@ls-al.com Operating system: RH 6.0 PHP version: 4.0.0 Release PHP Bug Type: Scripting Engine problem Bug description: Multiple File Upload work INCORRECT !!! As Manual .... ============================================================ Example 18-2. Uploading multiple forms 1 2 <form action="file-upload.html" method="post" enctype="multipart/form-data"> 3 Send these files:<br> 4 <input name="userfile[]" type="file"><br> 5 <input name="userfile[]" type="file"><br> 6 <input type="submit" value="Send files"> 7 </form> 8 When the above form is submitted, the arrays $userfile, $userfile_name, and $userfile_size will be formed in the global scope (as well as in $HTTP_POST_VARS). Each of these will be a numerically indexed array of the appropriate values for the submitted files. For instance, assume that the filenames /home/test/review.html and /home/test/xwp.out are submitted. In this case, $userfile_name[0] would contain the value review.html, and $userfile_name[1] would contain the value xwp.out. Similarly, $userfile_size[0] would contain review.html's filesize, and so forth. ============================================================ That's NOT TRUE.... For example , The FORM is.. ============================================================ First - <input type=file name=img[]> Second - <input type=file name=img[]> ============================================================ Script is below... ============================================================ echo count(img) is result 6 NOT 8.... -_-' for ($i = 0;$i<count($img);$i++) { echo img[$i] } is result img[0] = FILE_NAME OF FIRST FILE; img[1] = FILE_TYPE OF FIRST FILE; img[2] = FILE OF FIRST FILE; img[3] = FIE_NAME OF SECOND FILE; img[1] = FILE_TYPE OF SECOND FILE; img[2] = FILE OF SECOND FILE; AND echo img_name[0] is NULL... echo img_size[0] is NULL... echo img_type[0] is NULL... INDEX [1] is too.... What's wrong.....?

« previous php.dev (#21071) next »