{"action":"created","comment":{"url":"https://api.github.com/repos/php-fig/fig-standards/pulls/comments/29382463","id":29382463,"diff_hunk":"@@ -393,11 +393,150 @@ Implementations are expected to:\n   `Psr\\Http\\Message\\UploadedFileInterface` instance for the given location in\n   the tree.\n \n+The tree structure referenced should mimic the naming structure in which files\n+were submitted. \n+\n+In the simplest example, this might be a single named form element submitted as:\n+\n+```html\n+<input type=\"file\" name=\"avatar\" />\n+```\n+\n+In this case, the structure in `$_FILES` would look like:\n+\n+```php\n+array(\n+    'avatar' => array(\n+        'tmp_name' => 'phpUxcOty',\n+        'name' => 'my-avatar.png',\n+        'size' => 90996,\n+        'type' => 'image/png',\n+        'error' => 0,\n+    ),\n+)\n+```\n+\n+The normalized form returned by `getUploadedFiles()` would be:\n+\n+```php\n+array(\n+    'avatar' => /* UploadedFileInterface instance */\n+)\n+```\n+\n+In the case of an input using array notation for the name:\n+\n+```html\n+<input type=\"file\" name=\"my-form[details][avatar]\" />\n+```\n+\n+`$_FILES` ends up looking like this:\n+\n+```php\n+array(\n+    'my-form' => array(\n+        'details' => array(\n+            'avatar' => array(\n+                'tmp_name' => 'phpUxcOty',\n+                'name' => 'my-avatar.png',\n+                'size' => 90996,\n+                'type' => 'image/png',\n+                'error' => 0,\n+            ),\n+        ),\n+    ),\n+)\n+```\n+\n+And the corresponding tree returned by `getUploadedFiles()` should be:\n+\n+```php\n+array(\n+    'my-form' => array(\n+        'details' => array(\n+            'avatar' => /* UploadedFileInterface instance */\n+        ),\n+    ),\n+)\n+```\n+\n+In some cases, you may specify an array of files:\n+\n+```html\n+Upload an avatar: <input type=\"file\" \"name=\"my-form[details][avatars][]\" />\n+Upload an avatar: <input type=\"file\" \"name=\"my-form[details][avatars][]\" />\n+```\n+\n+(As an example, JavaScript controls might spawn additional file upload inputs to\n+allow uploading multiple files at once.)\n+\n+In such a case, the specification implementation must aggregate all information\n+related to the file at the given index. The reason is because `$_FILES` deviates\n+from its normal structure in such cases:\n+\n+```php\n+array(\n+    'my-form' => array(\n+        'details' => array(\n+            'avatars' => array(\n+                'tmp_name' => array(\n+                    0 => '...',\n+                    1 => '...',\n+                    2 => '...',\n+                ),\n+                'name' => array(\n+                    0 => '...',\n+                    1 => '...',\n+                    2 => '...',\n+                ),\n+                'size' => array(\n+                    0 => '...',\n+                    1 => '...',\n+                    2 => '...',\n+                ),\n+                'type' => array(\n+                    0 => '...',\n+                    1 => '...',\n+                    2 => '...',\n+                ),\n+                'error' => array(\n+                    0 => '...',\n+                    1 => '...',\n+                    2 => '...',\n+                ),\n+            ),\n+        ),\n+    ),\n+)\n+```\n+\n+An implementation of this specification would convert the above to:","path":"proposed/http-message.md","position":121,"original_position":121,"commit_id":"ca3ae26cdd9511153212de89b6a9ef1fda3b112e","original_commit_id":"ca3ae26cdd9511153212de89b6a9ef1fda3b112e","user":{"login":"simensen","id":191200,"avatar_url":"https://avatars.githubusercontent.com/u/191200?v=3","gravatar_id":"","url":"https://api.github.com/users/simensen","html_url":"https://github.com/simensen","followers_url":"https://api.github.com/users/simensen/followers","following_url":"https://api.github.com/users/simensen/following{/other_user}","gists_url":"https://api.github.com/users/simensen/gists{/gist_id}","starred_url":"https://api.github.com/users/simensen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simensen/subscriptions","organizations_url":"https://api.github.com/users/simensen/orgs","repos_url":"https://api.github.com/users/simensen/repos","events_url":"https://api.github.com/users/simensen/events{/privacy}","received_events_url":"https://api.github.com/users/simensen/received_events","type":"User","site_admin":false},"body":"Should this say \"could\" instead of \"would?\" It makes it seem like implementations MUST do it this way. While that is sensible, perhaps, it might tend to tip too far in the direction of dictating implementation details.","created_at":"2015-04-29T21:23:17Z","updated_at":"2015-04-29T21:23:17Z","html_url":"https://github.com/php-fig/fig-standards/pull/540#discussion_r29382463","pull_request_url":"https://api.github.com/repos/php-fig/fig-standards/pulls/540","_links":{"self":{"href":"https://api.github.com/repos/php-fig/fig-standards/pulls/comments/29382463"},"html":{"href":"https://github.com/php-fig/fig-standards/pull/540#discussion_r29382463"},"pull_request":{"href":"https://api.github.com/repos/php-fig/fig-standards/pulls/540"}}},"pull_request":{"url":"https://api.github.com/repos/php-fig/fig-standards/pulls/540","id":34204367,"html_url":"https://github.com/php-fig/fig-standards/pull/540","diff_url":"https://github.com/php-fig/fig-standards/pull/540.diff","patch_url":"https://github.com/php-fig/fig-standards/pull/540.patch","issue_url":"https://api.github.com/repos/php-fig/fig-standards/issues/540","number":540,"state":"open","locked":false,"title":"More detail on normalization of the uploaded files","user":{"login":"weierophinney","id":25943,"avatar_url":"https://avatars.githubusercontent.com/u/25943?v=3","gravatar_id":"","url":"https://api.github.com/users/weierophinney","html_url":"https://github.com/weierophinney","followers_url":"https://api.github.com/users/weierophinney/followers","following_url":"https://api.github.com/users/weierophinney/following{/other_user}","gists_url":"https://api.github.com/users/weierophinney/gists{/gist_id}","starred_url":"https://api.github.com/users/weierophinney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weierophinney/subscriptions","organizations_url":"https://api.github.com/users/weierophinney/orgs","repos_url":"https://api.github.com/users/weierophinney/repos","events_url":"https://api.github.com/users/weierophinney/events{/privacy}","received_events_url":"https://api.github.com/users/weierophinney/received_events","type":"User","site_admin":false},"body":"Per @Crell, taking a stab at clarifying what the \"tree of files\" looks like, and\nwhat normalization needs to be done.","created_at":"2015-04-27T20:00:59Z","updated_at":"2015-04-29T21:23:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"15eede150ad030a502dabb28be7206a53f972e71","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/php-fig/fig-standards/pulls/540/commits","review_comments_url":"https://api.github.com/repos/php-fig/fig-standards/pulls/540/comments","review_comment_url":"https://api.github.com/repos/php-fig/fig-standards/pulls/comments{/number}","comments_url":"https://api.github.com/repos/php-fig/fig-standards/issues/540/comments","statuses_url":"https://api.github.com/repos/php-fig/fig-standards/statuses/ca3ae26cdd9511153212de89b6a9ef1fda3b112e","head":{"label":"weierophinney:hotfix/file-tree-structure","ref":"hotfix/file-tree-structure","sha":"ca3ae26cdd9511153212de89b6a9ef1fda3b112e","user":{"login":"weierophinney","id":25943,"avatar_url":"https://avatars.githubusercontent.com/u/25943?v=3","gravatar_id":"","url":"https://api.github.com/users/weierophinney","html_url":"https://github.com/weierophinney","followers_url":"https://api.github.com/users/weierophinney/followers","following_url":"https://api.github.com/users/weierophinney/following{/other_user}","gists_url":"https://api.github.com/users/weierophinney/gists{/gist_id}","starred_url":"https://api.github.com/users/weierophinney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weierophinney/subscriptions","organizations_url":"https://api.github.com/users/weierophinney/orgs","repos_url":"https://api.github.com/users/weierophinney/repos","events_url":"https://api.github.com/users/weierophinney/events{/privacy}","received_events_url":"https://api.github.com/users/weierophinney/received_events","type":"User","site_admin":false},"repo":{"id":1053294,"name":"fig-standards","full_name":"weierophinney/fig-standards","owner":{"login":"weierophinney","id":25943,"avatar_url":"https://avatars.githubusercontent.com/u/25943?v=3","gravatar_id":"","url":"https://api.github.com/users/weierophinney","html_url":"https://github.com/weierophinney","followers_url":"https://api.github.com/users/weierophinney/followers","following_url":"https://api.github.com/users/weierophinney/following{/other_user}","gists_url":"https://api.github.com/users/weierophinney/gists{/gist_id}","starred_url":"https://api.github.com/users/weierophinney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weierophinney/subscriptions","organizations_url":"https://api.github.com/users/weierophinney/orgs","repos_url":"https://api.github.com/users/weierophinney/repos","events_url":"https://api.github.com/users/weierophinney/events{/privacy}","received_events_url":"https://api.github.com/users/weierophinney/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/weierophinney/fig-standards","description":"Standards either proposed or approved by the Framework Interop Group","fork":true,"url":"https://api.github.com/repos/weierophinney/fig-standards","forks_url":"https://api.github.com/repos/weierophinney/fig-standards/forks","keys_url":"https://api.github.com/repos/weierophinney/fig-standards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/weierophinney/fig-standards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/weierophinney/fig-standards/teams","hooks_url":"https://api.github.com/repos/weierophinney/fig-standards/hooks","issue_events_url":"https://api.github.com/repos/weierophinney/fig-standards/issues/events{/number}","events_url":"https://api.github.com/repos/weierophinney/fig-standards/events","assignees_url":"https://api.github.com/repos/weierophinney/fig-standards/assignees{/user}","branches_url":"https://api.github.com/repos/weierophinney/fig-standards/branches{/branch}","tags_url":"https://api.github.com/repos/weierophinney/fig-standards/tags","blobs_url":"https://api.github.com/repos/weierophinney/fig-standards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/weierophinney/fig-standards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/weierophinney/fig-standards/git/refs{/sha}","trees_url":"https://api.github.com/repos/weierophinney/fig-standards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/weierophinney/fig-standards/statuses/{sha}","languages_url":"https://api.github.com/repos/weierophinney/fig-standards/languages","stargazers_url":"https://api.github.com/repos/weierophinney/fig-standards/stargazers","contributors_url":"https://api.github.com/repos/weierophinney/fig-standards/contributors","subscribers_url":"https://api.github.com/repos/weierophinney/fig-standards/subscribers","subscription_url":"https://api.github.com/repos/weierophinney/fig-standards/subscription","commits_url":"https://api.github.com/repos/weierophinney/fig-standards/commits{/sha}","git_commits_url":"https://api.github.com/repos/weierophinney/fig-standards/git/commits{/sha}","comments_url":"https://api.github.com/repos/weierophinney/fig-standards/comments{/number}","issue_comment_url":"https://api.github.com/repos/weierophinney/fig-standards/issues/comments{/number}","contents_url":"https://api.github.com/repos/weierophinney/fig-standards/contents/{+path}","compare_url":"https://api.github.com/repos/weierophinney/fig-standards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/weierophinney/fig-standards/merges","archive_url":"https://api.github.com/repos/weierophinney/fig-standards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/weierophinney/fig-standards/downloads","issues_url":"https://api.github.com/repos/weierophinney/fig-standards/issues{/number}","pulls_url":"https://api.github.com/repos/weierophinney/fig-standards/pulls{/number}","milestones_url":"https://api.github.com/repos/weierophinney/fig-standards/milestones{/number}","notifications_url":"https://api.github.com/repos/weierophinney/fig-standards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/weierophinney/fig-standards/labels{/name}","releases_url":"https://api.github.com/repos/weierophinney/fig-standards/releases{/id}","created_at":"2010-11-05T05:05:40Z","updated_at":"2015-04-13T19:14:11Z","pushed_at":"2015-04-29T16:48:34Z","git_url":"git://github.com/weierophinney/fig-standards.git","ssh_url":"git@github.com:weierophinney/fig-standards.git","clone_url":"https://github.com/weierophinney/fig-standards.git","svn_url":"https://github.com/weierophinney/fig-standards","homepage":"","size":1814,"stargazers_count":4,"watchers_count":4,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":4,"default_branch":"master"}},"base":{"label":"php-fig:master","ref":"master","sha":"74a034bfacf6899f35acac8a8ae304ca2b050c4d","user":{"login":"php-fig","id":468401,"avatar_url":"https://avatars.githubusercontent.com/u/468401?v=3","gravatar_id":"","url":"https://api.github.com/users/php-fig","html_url":"https://github.com/php-fig","followers_url":"https://api.github.com/users/php-fig/followers","following_url":"https://api.github.com/users/php-fig/following{/other_user}","gists_url":"https://api.github.com/users/php-fig/gists{/gist_id}","starred_url":"https://api.github.com/users/php-fig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php-fig/subscriptions","organizations_url":"https://api.github.com/users/php-fig/orgs","repos_url":"https://api.github.com/users/php-fig/repos","events_url":"https://api.github.com/users/php-fig/events{/privacy}","received_events_url":"https://api.github.com/users/php-fig/received_events","type":"Organization","site_admin":false},"repo":{"id":1053270,"name":"fig-standards","full_name":"php-fig/fig-standards","owner":{"login":"php-fig","id":468401,"avatar_url":"https://avatars.githubusercontent.com/u/468401?v=3","gravatar_id":"","url":"https://api.github.com/users/php-fig","html_url":"https://github.com/php-fig","followers_url":"https://api.github.com/users/php-fig/followers","following_url":"https://api.github.com/users/php-fig/following{/other_user}","gists_url":"https://api.github.com/users/php-fig/gists{/gist_id}","starred_url":"https://api.github.com/users/php-fig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php-fig/subscriptions","organizations_url":"https://api.github.com/users/php-fig/orgs","repos_url":"https://api.github.com/users/php-fig/repos","events_url":"https://api.github.com/users/php-fig/events{/privacy}","received_events_url":"https://api.github.com/users/php-fig/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/php-fig/fig-standards","description":"Standards either proposed or approved by the Framework Interop Group","fork":false,"url":"https://api.github.com/repos/php-fig/fig-standards","forks_url":"https://api.github.com/repos/php-fig/fig-standards/forks","keys_url":"https://api.github.com/repos/php-fig/fig-standards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/php-fig/fig-standards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/php-fig/fig-standards/teams","hooks_url":"https://api.github.com/repos/php-fig/fig-standards/hooks","issue_events_url":"https://api.github.com/repos/php-fig/fig-standards/issues/events{/number}","events_url":"https://api.github.com/repos/php-fig/fig-standards/events","assignees_url":"https://api.github.com/repos/php-fig/fig-standards/assignees{/user}","branches_url":"https://api.github.com/repos/php-fig/fig-standards/branches{/branch}","tags_url":"https://api.github.com/repos/php-fig/fig-standards/tags","blobs_url":"https://api.github.com/repos/php-fig/fig-standards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/php-fig/fig-standards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/php-fig/fig-standards/git/refs{/sha}","trees_url":"https://api.github.com/repos/php-fig/fig-standards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/php-fig/fig-standards/statuses/{sha}","languages_url":"https://api.github.com/repos/php-fig/fig-standards/languages","stargazers_url":"https://api.github.com/repos/php-fig/fig-standards/stargazers","contributors_url":"https://api.github.com/repos/php-fig/fig-standards/contributors","subscribers_url":"https://api.github.com/repos/php-fig/fig-standards/subscribers","subscription_url":"https://api.github.com/repos/php-fig/fig-standards/subscription","commits_url":"https://api.github.com/repos/php-fig/fig-standards/commits{/sha}","git_commits_url":"https://api.github.com/repos/php-fig/fig-standards/git/commits{/sha}","comments_url":"https://api.github.com/repos/php-fig/fig-standards/comments{/number}","issue_comment_url":"https://api.github.com/repos/php-fig/fig-standards/issues/comments{/number}","contents_url":"https://api.github.com/repos/php-fig/fig-standards/contents/{+path}","compare_url":"https://api.github.com/repos/php-fig/fig-standards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/php-fig/fig-standards/merges","archive_url":"https://api.github.com/repos/php-fig/fig-standards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/php-fig/fig-standards/downloads","issues_url":"https://api.github.com/repos/php-fig/fig-standards/issues{/number}","pulls_url":"https://api.github.com/repos/php-fig/fig-standards/pulls{/number}","milestones_url":"https://api.github.com/repos/php-fig/fig-standards/milestones{/number}","notifications_url":"https://api.github.com/repos/php-fig/fig-standards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/php-fig/fig-standards/labels{/name}","releases_url":"https://api.github.com/repos/php-fig/fig-standards/releases{/id}","created_at":"2010-11-05T04:44:12Z","updated_at":"2015-04-29T21:00:22Z","pushed_at":"2015-04-29T16:48:34Z","git_url":"git://github.com/php-fig/fig-standards.git","ssh_url":"git@github.com:php-fig/fig-standards.git","clone_url":"https://github.com/php-fig/fig-standards.git","svn_url":"https://github.com/php-fig/fig-standards","homepage":"http://www.php-fig.org/","size":7281,"stargazers_count":5960,"watchers_count":5960,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1445,"mirror_url":null,"open_issues_count":82,"forks":1445,"open_issues":82,"watchers":5960,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/php-fig/fig-standards/pulls/540"},"html":{"href":"https://github.com/php-fig/fig-standards/pull/540"},"issue":{"href":"https://api.github.com/repos/php-fig/fig-standards/issues/540"},"comments":{"href":"https://api.github.com/repos/php-fig/fig-standards/issues/540/comments"},"review_comments":{"href":"https://api.github.com/repos/php-fig/fig-standards/pulls/540/comments"},"review_comment":{"href":"https://api.github.com/repos/php-fig/fig-standards/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/php-fig/fig-standards/pulls/540/commits"},"statuses":{"href":"https://api.github.com/repos/php-fig/fig-standards/statuses/ca3ae26cdd9511153212de89b6a9ef1fda3b112e"}}}}