I've always assumed it was for security.

Imagine something like:

<input type="file" name="upload[tmp_name]" />

Realistically, if you tried to access the value as a string, you would get "Array" either way. But I still wouldn't want users to be able to "pollute" $_FILES for people who were assuming a non-array upload.

The way it is now, $_FILES['upload']['tmp_name'] is always actually what you think it is, it just might be a string or an array structure. But at least it definitely didn't come from the user.

-[Unknown]


-------- Original Message --------

I was wondering if anyone could point me to a resource explaining why
the _FILES array is structured as it is with html arrays. I've been
googling and reading rfc1867.c and finding very little explanation.

The _FILES[$key]['temp_name'][$key] is quite awkward when dealing with
multiple uploads.

I found it as a bug, but the only response to someone posting about the
awkwardness was, it is not a bug and will not be fixed.

I'd just really like to know why the structure is the way it is.. It's
an inconsistency with other html arrays that really confuses me.

If it's old news, please reply to me off list instead of wasting
valuable developer time on an old discussion.

.darrel.

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to