- Announcements
- Code review
- Lecture
- Lab intro
- Create a new S3 Bucket
- Create an "open" policy
{
"Version": "2012-10-17",
"Id": "Policy1562466412724",
"Statement": [
{
"Sid": "Stmt1562466394793",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:*",
"Resource": "YOUR ARN HERE
}
]
}
- You'll need to use an html form, POSTing to your server, using the encoding type "multipart"
<form action="http://localhost:3000/route" method="post" enctype="multipart/form-data">
- Every input field must have a
name
- You must have an
<input type='file' />
to store the file for upload
- Multi Part forms are broken into sections or chunks by the browser, simulating TCP-like packets so the back-end server can handle large amounts of data
- These chunks are split by "boundaries", which your application needs to digest, not unlike
- Query Strings
- Post Data
- JSON Body
------WebKitFormBoundaryCN5NrYyqER1HdCXn
Content-Disposition: form-data; name="person"
Johnny Socko
------WebKitFormBoundaryCN5NrYyqER1HdCXn
Content-Disposition: form-data; name="old"
false
------WebKitFormBoundaryCN5NrYyqER1HdCXn
Content-Disposition: form-data; name="file"; filename=""
Content-Type: application/octet-stream
BinaryFileNonsenseInHere...
On the server side, you'll need to connect to your S3 Bucket using your AWS Developer Credentials.
References