php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: wies at mailcity dot com
New email:
PHP Version: OS:

 

 [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">
        </form>
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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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
http://www.ldsys.net/~cgs/php/

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] rasmus@php.net
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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 15:01:28 2024 UTC