php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1951 file upload arrays don't work properly
Submitted: 1999-08-03 14:27 UTC Modified: 2000-03-03 14:58 UTC
From: paul at alphabitmedia dot com Assigned:
Status: Closed Package: Other
PHP Version: 3.0.12 OS: Solaris 5.6
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: paul at alphabitmedia dot com
New email:
PHP Version: OS:

 

 [1999-08-03 14:27 UTC] paul at alphabitmedia dot com
okay, so I have this, which works:

========================================================================
<form enctype="multipart/form-data" method="post" action="<?php echo
$PHP_SELF ?>">
<p><input name="image" type="file">
<p><input type="submit" name="submit" value="Upload">
</form>

<?php
if ($submit) {
 echo "temp file: " .$image."<br>\n";
 echo "file name: " .$image_name."<br>\n";
 echo "file size: " .$image_size."<br>\n";
 echo "file type: " .$image_type."<br>\n";
}
?>
========================================================================


but this doesn't:

========================================================================
<form enctype="multipart/form-data" method="post" action="<?php echo
$PHP_SELF ?>">
<p><input name="image[1]" type="file">
<p><input type="submit" name="submit" value="Upload">
</form>

<?php

if ($submit) {
 echo "temp file: " .$image[1]."<br>\n";
 echo "file name: " .$image_name[1]."<br>\n";
 echo "file size: " .$image_size[1]."<br>\n";
 echo "file type: " .$image_type[1]."<br>\n";
}

?>
========================================================================


the only difference is image[1] instead of image.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-03-03 14:58 UTC] sas at cvs dot php dot net
This is implemented in the upcoming PHP 4.0. Thanks!
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jan 05 02:01:28 2025 UTC