|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3728 Multiple uploading array doesn't initialize $userfile_type[]
Submitted: 2000-03-04 22:13 UTC Modified: 2000-10-14 21:47 UTC
From: wies at mailcity dot com Assigned:
Status: Closed Package: *General Issues
PHP Version: 4.0.2 OS: Linux (Redhat 6.2)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
21 - 5 = ?
Subscribe to this entry?

 [2000-03-04 22:13 UTC] wies at mailcity dot com
The HTML part:
<form ENCTYPE="multipart/form-data" action="script.php" method="post">
        <input type="file" name="file[]">
        <br><input type="file" name="file[]">
        <p><input type="submit" value="Upload files">
The PHP part:
<? echo "$file_type[0]"; ?>

The script should produce something like "image/gif", but instead produces nothing.

My configure line: ./configure '--with-mysql' '--with-apache=../apache_1.3.11' '--enable-track-vars' '--with-imap' '--with-pcre-regex'

$file[0], $file_name[0], $file_size[0] all work, as well as $file_type on a single-upload form.

The problem exists in 3.0.14 as well.  I noticed that someone else mentioned this on the Documentation page for multipe uploads, but there doesn't seem to be a previous bug report on the problem.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2000-03-07 21:01 UTC] wies at mailcity dot com
I guess this bug has been around since at least 3.0.12, and the PHP dev team
was sent this patch before, but the bug still exists.
chris was kind enough to send me a patch to fix this problem:

You can find the patch at

Thanks chris!
 [2000-10-13 23:18 UTC] wies at mailcity dot com
Just resubmitting this with a newer version of PHP listed, since it has not been fixed yet.
 [2000-10-13 23:23 UTC]
You mention PHP 3.0.x in your report but listed it as a PHP 4 bug.  Are you seeing this in the latest PHP 4?  I'm pretty sure I fixed this a while ago in PHP 4.
 [2000-10-14 21:47 UTC] wies at mailcity dot com
rasmus was quite correct.  After upgrading to 4.0.2, it does work.  Good work!
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Nov 30 15:01:27 2020 UTC