Skip to content

Instantly share code, notes, and snippets.

@nidhinp
Last active August 13, 2019 19:35
Show Gist options
  • Save nidhinp/37c53ecee08e83781a7b8ed5a4b9f123 to your computer and use it in GitHub Desktop.
Save nidhinp/37c53ecee08e83781a7b8ed5a4b9f123 to your computer and use it in GitHub Desktop.
def get_presigned_url():
s3 = boto3.client('s3')
bucket = "your-s3-bucket-name"
return s3.generate_presigned_post(
Bucket=bucket,
Key="media/screenshots/login.png",
Fields={"acl": "public-read", "Content-Type": "png"},
Conditions=[
{"acl": "public-read"},
{"Content-Type": "png"}
],
ExpiresIn=3600
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment