Skip to content

JackPott/s3-presigned-upload-poc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

S3 Upload with pre-signed URLS

This is a simple proof of concept to demonstrate uploading files to S3 with a presigned URL, avoiding the need for the client to do any AWS authentication directly, and avoiding the need to stream large files via a backend API before storing it in S3.

Where to look

main.py shows the backend code with two simple methods for generating an upload URL, and returning a list of objects in the bucket with download URLS

index.html has the Javascript in it which lets the client get the URL asyncronously and PUT the file to it. Has some minor embelishment to show off the bucket contents in a pretty way.

Run it locally

# Install deps and venv, requires poetry
poetry install --no-root

# Auth shell to AWS
aws-vault exec sandbox-ca

# Load venv
source .venv/bin/activate

# Start webserver
python3 main.py 

# Go to localhost:8000 in browser

Note bucket name is hardcoded in main.py

TODO:

  • Upload a demo video

About

Proof of concept to demonstrate uploading files to S3 with a pre-signed URL

Topics

Resources

License

Stars

Watchers

Forks