Bug w/ multi-dimensional form elements and file uploads?
| From: | Sascha Schumann | Date: | Fri, 19 Jan 2001 13:08:35 +0000 |
| Subject: | Bug w/ multi-dimensional form elements and file uploads? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-44545@lists.php.net to get a copy of this message | ||
Hi,
please consider this part of a form:
<input name="Data[user][foo]" type="text">
<input name="Data[user][bar]" type="file">
The file upload code adds Data[user][foo] properly to
HTTP_POST_FILES. But then, it tries to add variables like
these:
Data[user]_name[bar]
Data[user]_size[bar]
Data[user]_type[bar]
php_register_variable_ex() decides then to nuke the existing
Data[user] entry from the HTTP_POST_FILES hash (because it
sees _name instead of [.*]), so that the previously set
Data[user][foo] entry becomes inaccessible.
Questions:
1. Is this supposed to work at all?
2. What do you think of adding Data_name[user][bar] instead
of the above form?
- Sascha