Skip to content

murrekatt/go-aws-s3-presigned-post-app-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-aws-s3-presigned-post-app-engine

Example showing AWS S3 pre-signed POST.

Run locally

1. You'll need to have the Go App Engine SDK installed and working.

2. Clone this repo.

3. Create an AWS S3 test bucket with public-read

Bucket Policy:

{
  "Version": "2012-10-17",
  "Id": "Policy1234567890",
  "Statement": [{
    "Sid": "Stmt1234567890",
    "Effect": "Allow",
    "Principal": {
      "AWS": "*"
    },
    "Action": "s3:GetObject",
    "Resource": "arn:aws:s3:::bucketnamehere/*"
  }]
}

4. Configure the AWS credentials in s3.go

S3 credentials:

const (
   	regionName = "FILL-ME-IN"
    bucketName = "FILL-ME-IN"
    accessKeyID = "FILL-ME-IN"
    secretAccessKey = "FILL-ME-IN"
)

5. run the app locally

$ goapp serve

6. Open localhost:8080/upload with your browser.

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.

About

Example showing AWS S3 pre-signed POST

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages