php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #25589 Problem with the Structure of $_FILES
Submitted: 2003-09-18 10:34 UTC Modified: 2003-09-18 20:16 UTC
Votes:3
Avg. Score:4.0 ± 0.8
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:1 (33.3%)
From: lakario at msn dot com Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: 4.3.3 OS: All
Private report: No CVE-ID: None
 [2003-09-18 10:34 UTC] lakario at msn dot com
Description:
------------
>The default format for $_FILES is $_FILES['variable']['element'] which of course works fine, following this format I would assume that the format for a variable inside an array would be $_FILES['array']['variable']['element'] but on the contrary it is in fact $_FILES['array']['element']['variable'].  Somehow this doesn't seem quite right to me.  Granted, it still works just as well but it sort of breaks the traditional naming structure for an array and really jumbles the logical flow of things.

Reproduce code:
---------------
This is basically formality and really doesn't need to be hear at all, but here you go; a sample HTML form that will produce the error:

<form action="blah" method="post">
<input type="file" name="array[file]">
<input type="submit" name="" value="Submit">
</form>

Expected result:
----------------
The form ideally should send back the file contained within $_FILES as $_FILES['array']['file']['element'].

Actual result:
--------------
The form in fact sends back the file contained in $_FILES as $_FILES['array']['element']['file'].

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-18 20:16 UTC] sniper@php.net
This will not be changed due to backwards compatibility issues.

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Jun 06 18:01:26 2025 UTC