{"action":"created","issue":{"url":"https://api.github.com/repos/ga-wdi-boston/group-project/issues/76","repository_url":"https://api.github.com/repos/ga-wdi-boston/group-project","labels_url":"https://api.github.com/repos/ga-wdi-boston/group-project/issues/76/labels{/name}","comments_url":"https://api.github.com/repos/ga-wdi-boston/group-project/issues/76/comments","events_url":"https://api.github.com/repos/ga-wdi-boston/group-project/issues/76/events","html_url":"https://github.com/ga-wdi-boston/group-project/issues/76","id":140534309,"number":76,"title":"AWS uploads: s3.upload or formdata?","user":{"login":"MFBrewster","id":8867447,"avatar_url":"https://avatars.githubusercontent.com/u/8867447?v=3","gravatar_id":"","url":"https://api.github.com/users/MFBrewster","html_url":"https://github.com/MFBrewster","followers_url":"https://api.github.com/users/MFBrewster/followers","following_url":"https://api.github.com/users/MFBrewster/following{/other_user}","gists_url":"https://api.github.com/users/MFBrewster/gists{/gist_id}","starred_url":"https://api.github.com/users/MFBrewster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MFBrewster/subscriptions","organizations_url":"https://api.github.com/users/MFBrewster/orgs","repos_url":"https://api.github.com/users/MFBrewster/repos","events_url":"https://api.github.com/users/MFBrewster/events{/privacy}","received_events_url":"https://api.github.com/users/MFBrewster/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-03-13T22:03:03Z","updated_at":"2016-03-14T15:58:44Z","closed_at":"2016-03-14T15:58:44Z","body":"We have been trying to upload a file to s3 using an HTML form. In the aws docs I found this sample code for an HTML form which sends a file to s3 from a custom form: \r\n\r\n```\r\n<form action=\"https://s3-bucket.s3.amazonaws.com/\" method=\"post\" enctype=\"multipart/form-data\">\r\n      <input type=\"hidden\" name=\"key\" value=\"uploads/${filename}\">\r\n      <input type=\"hidden\" name=\"AWSAccessKeyId\" value=\"YOUR_AWS_ACCESS_KEY\"> \r\n      <input type=\"hidden\" name=\"acl\" value=\"private\"> \r\n      <input type=\"hidden\" name=\"success_action_redirect\" value=\"http://localhost/\">\r\n      <input type=\"hidden\" name=\"policy\" value=\"YOUR_POLICY_DOCUMENT_BASE64_ENCODED\">\r\n      <input type=\"hidden\" name=\"signature\" value=\"YOUR_CALCULATED_SIGNATURE\">\r\n      <input type=\"hidden\" name=\"Content-Type\" value=\"image/jpeg\">\r\n      <!-- Include any additional input fields here -->\r\n\r\n      File to upload to S3: \r\n      <input name=\"file\" type=\"file\"> \r\n      <br> \r\n      <input type=\"submit\" value=\"Upload File to S3\"> \r\n    </form> \r\n```\r\n\r\nThe drawbacks to this approach are obvious: by hard-coding data about the form into the HTML, it is publicly available, as well as inflexible because there is little access to the javascript without a messy tangle of jQuery listeners. \r\n\r\nWith all of that said, I do not have any idea how to bridge the gap between an HTML form and the s3.upload function which you used during the express-multer-client demonstration. The s3 docs give the following example code:\r\n```\r\nvar params = {Bucket: 'bucket', Key: 'key', Body: stream};\r\ns3.upload(params, function(err, data) {\r\n  console.log(err, data);\r\n});\r\n```\r\nIs there any way to access a particular attribute of a Formdata object (like a file uploaded as part of a form), so as to append that attribute to params.body and upload the file that way? Or is that a completely incorrect approach?"},"comment":{"url":"https://api.github.com/repos/ga-wdi-boston/group-project/issues/comments/196383038","html_url":"https://github.com/ga-wdi-boston/group-project/issues/76#issuecomment-196383038","issue_url":"https://api.github.com/repos/ga-wdi-boston/group-project/issues/76","id":196383038,"user":{"login":"MFBrewster","id":8867447,"avatar_url":"https://avatars.githubusercontent.com/u/8867447?v=3","gravatar_id":"","url":"https://api.github.com/users/MFBrewster","html_url":"https://github.com/MFBrewster","followers_url":"https://api.github.com/users/MFBrewster/followers","following_url":"https://api.github.com/users/MFBrewster/following{/other_user}","gists_url":"https://api.github.com/users/MFBrewster/gists{/gist_id}","starred_url":"https://api.github.com/users/MFBrewster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MFBrewster/subscriptions","organizations_url":"https://api.github.com/users/MFBrewster/orgs","repos_url":"https://api.github.com/users/MFBrewster/repos","events_url":"https://api.github.com/users/MFBrewster/events{/privacy}","received_events_url":"https://api.github.com/users/MFBrewster/received_events","type":"User","site_admin":false},"created_at":"2016-03-14T15:58:44Z","updated_at":"2016-03-14T15:58:44Z","body":"We were able to figure this out. Closing for now"}}