{"action":"created","issue":{"url":"https://api.github.com/repos/aws/aws-sdk-php/issues/1143","repository_url":"https://api.github.com/repos/aws/aws-sdk-php","labels_url":"https://api.github.com/repos/aws/aws-sdk-php/issues/1143/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-sdk-php/issues/1143/comments","events_url":"https://api.github.com/repos/aws/aws-sdk-php/issues/1143/events","html_url":"https://github.com/aws/aws-sdk-php/issues/1143","id":196319181,"number":1143,"title":"Uploading a file with PostObjectV4 into a bucket's folder results in a filename of folder/{$filename}","user":{"login":"jjmontgo","id":11598913,"avatar_url":"https://avatars.githubusercontent.com/u/11598913?v=3","gravatar_id":"","url":"https://api.github.com/users/jjmontgo","html_url":"https://github.com/jjmontgo","followers_url":"https://api.github.com/users/jjmontgo/followers","following_url":"https://api.github.com/users/jjmontgo/following{/other_user}","gists_url":"https://api.github.com/users/jjmontgo/gists{/gist_id}","starred_url":"https://api.github.com/users/jjmontgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjmontgo/subscriptions","organizations_url":"https://api.github.com/users/jjmontgo/orgs","repos_url":"https://api.github.com/users/jjmontgo/repos","events_url":"https://api.github.com/users/jjmontgo/events{/privacy}","received_events_url":"https://api.github.com/users/jjmontgo/received_events","type":"User","site_admin":false},"labels":[{"id":16749030,"url":"https://api.github.com/repos/aws/aws-sdk-php/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-12-19T02:32:53Z","updated_at":"2016-12-19T23:06:00Z","closed_at":null,"body":"Hello!\r\n\r\nI'm pretty new to this and I realize this question may not be specific to the SDK.  I'm trying to create an upload form to add a file into a folder within a bucket using \\Aws\\S3\\PostObjectV4.\r\n\r\nI'm guessing I have to set the key with the name of the folder like so:\r\n```\r\n\t\t// Set some defaults for form input fields\r\n\t\t$formInputs = [\r\n\t\t\t'acl' => 'public-read',\r\n\t\t\t'key' => 'folder/{$filename}' \r\n\t\t];\r\n```\r\nAnd later pass those form inputs to PostObjectV4:\r\n\r\n```\r\n\t\t$postObject = new \\Aws\\S3\\PostObjectV4(\r\n\t\t    $client,\r\n\t\t    $this->bucketName,\r\n\t\t    $formInputs,\r\n\t\t    $options,\r\n\t\t    $expires\r\n\t\t);\r\n```\r\n\r\nHowever, when the file is uploaded, while it appears in the right folder it is named {$filename}.  I think I've been consistent with the documentation around the key, which states:\r\n\r\n> To use the file name provided by the user, use the ${filename} variable. For example, if the user Betty uploads the file lolcatz.jpg and you specify /user/betty/${filename}, the key name will be /user/betty/lolcatz.jpg.\r\n\r\nCan anyone let me know what I'm doing wrong here?\r\n\r\n/ Jonathan"},"comment":{"url":"https://api.github.com/repos/aws/aws-sdk-php/issues/comments/268104888","html_url":"https://github.com/aws/aws-sdk-php/issues/1143#issuecomment-268104888","issue_url":"https://api.github.com/repos/aws/aws-sdk-php/issues/1143","id":268104888,"user":{"login":"bakura10","id":1198915,"avatar_url":"https://avatars.githubusercontent.com/u/1198915?v=3","gravatar_id":"","url":"https://api.github.com/users/bakura10","html_url":"https://github.com/bakura10","followers_url":"https://api.github.com/users/bakura10/followers","following_url":"https://api.github.com/users/bakura10/following{/other_user}","gists_url":"https://api.github.com/users/bakura10/gists{/gist_id}","starred_url":"https://api.github.com/users/bakura10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bakura10/subscriptions","organizations_url":"https://api.github.com/users/bakura10/orgs","repos_url":"https://api.github.com/users/bakura10/repos","events_url":"https://api.github.com/users/bakura10/events{/privacy}","received_events_url":"https://api.github.com/users/bakura10/received_events","type":"User","site_admin":false},"created_at":"2016-12-19T23:06:00Z","updated_at":"2016-12-19T23:06:00Z","body":"Everything seems correct to me :/. The only difference between your code and mine is that I pass an empty array as third parameters while you do pass form inputs (I generate them manually in the HTML). But I don't think this can have any impact at all...\r\n\r\nSorry :(. I'll let someone from AWS answering you!"}}
{"actor":{"display_login":"bakura10"}}