php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4969 Multiple File Upload work INCORRECT !!!
Submitted: 2000-06-12 05:00 UTC Modified: 2000-08-18 18:40 UTC
From: fith at ls-al dot com Assigned: zak (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.0 Release OS: RH 6.0
Private report: No CVE-ID: None
 [2000-06-12 05:00 UTC] fith at ls-al dot com
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.....?



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-26 20:24 UTC] zak@php.net
Will try to confirm bug.
 [2000-08-06 00:16 UTC] zak@php.net
There have been a series of fixes to the file upload feature over the last week.  Could you please try installing the most recent CVS release of PHP and confirm if the problem is still happening?
 [2000-08-18 18:40 UTC] sniper@php.net
No feedback from user.

--Jani
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 03:01:28 2024 UTC