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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 17:01:33 2024 UTC