https://github.com/kaihendry/s3post
Golang sample to POST directly to an S3 bucket!
https://github.com/kaihendry/s3post
aws file post s3 s3-storage upload
Last synced: 4 months ago
JSON representation
Golang sample to POST directly to an S3 bucket!
- Host: GitHub
- URL: https://github.com/kaihendry/s3post
- Owner: kaihendry
- Created: 2016-04-11T10:26:58.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2025-11-25T19:28:01.000Z (7 months ago)
- Last Synced: 2026-02-20T07:40:58.914Z (4 months ago)
- Topics: aws, file, post, s3, s3-storage, upload
- Language: Go
- Homepage: https://up.dabase.com/
- Size: 346 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Video explaining the project: https://www.youtube.com/watch?v=75XYVGakPWI
# Authenticated AJAX POST to AWS S3 example 🙌
Requires the following environment variables to be set:
* BUCKET e.g. s.natalian.org, same domain as my CloudFront domain, https://s.natalian.org
* PASSWORD e.g. "abracadabra" used to authenticate the client via a cookie
* REGION e.g. ap-southeast-1, where the bucket is located
* UPLOAD_ID the AWS_ACCESS_KEY_ID for uploading to the bucket only
* UPLOAD_SECRET the secret AWS_SECRET_ACCESS_KEY counterpart to the restricted AWS_ACCESS_KEY_ID
* NOTIFY_TOPIC SNS topic that publishes the key of the upload
# S3 policy for restricting bucket upload
{ "Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1460356082000",
"Effect": "Allow",
"Action": [
"s3:Put*"
],
"Resource": [ "arn:aws:s3:::s.natalian.org", "arn:aws:s3:::s.natalian.org/*" ]
}
]
}
TODO is to implement a native Golang SDK function without UPLOAD_ID/UPLOAD_SECRET
[createPresignedPost](https://github.com/aws/aws-sdk-go-v2/issues/171)
https://github.com/TTLabs/EvaporateJS is far too complex. [Alex
Russell](https://twitter.com/slightlylate/status/1059599437998186498) says
[they are working on
it!](https://www.chromestatus.com/feature/5712608971718656)