Hello,
I have a legacy application where I included PSR-7 specification in the
process of modernizing.
Looking at the PSR-7 section about UploadedFileInterface, I saw some false
descriptions of how $_FILES works.
I uploaded a file in 'my-form[details][avatar]' field of form-data, I ended
up with the following array in $_FILES:
Version of PHP used:
> PHP 5.6.27-0+deb8u1 (cli) (built: Oct 15 2016 15:53:28)
> Copyright (c) 1997-2016 The PHP Group
> Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
> with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend
> Technologies
> with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans
>
array (
'my-form' => array (
'name' => array (
'details' => array (
'avatars' => 'learny-bn.jpg',
),
),
'type' => array (
'details' => array (
'avatars' => 'image/jpeg',
),
),
'tmp_name' => array (
'details' => array (
'avatars' => '/data/tmp/phpRq7Gzy',
),
),
'error' => array (
'details' => array (
'avatars' => 0,
),
),
'size' => array (
'details' => array (
'avatars' => 19600,
),
),
),
)
As you can see, it is different from what is indicated in behavior
description where all 5 keys are in the same leaf array. Instead, I have
keys of second level of $_FILES being 'tmp_name', 'name', 'size', 'type' &
'error'.
I think this description file should be changed as implementors could be
misled by the wrong description. Or did I missed something in my config?
Cheers,
Benoît
--
You received this message because you are subscribed to the Google Groups "PHP
Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/php-fig/1f7c13be-6f63-4154-9f53-c679aae517bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.