Example showing AWS S3 pre-signed POST.
Bucket Policy:
{
"Version": "2012-10-17",
"Id": "Policy1234567890",
"Statement": [{
"Sid": "Stmt1234567890",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::bucketnamehere/*"
}]
}
S3 credentials:
const (
regionName = "FILL-ME-IN"
bucketName = "FILL-ME-IN"
accessKeyID = "FILL-ME-IN"
secretAccessKey = "FILL-ME-IN"
)
$ goapp serve
You should now see the HTML form so you can select a file to upload. Assuming all setup is correct, the file will be uploaded to the S3 bucket.