Guest User

Untitled

a guest
Aug 25th, 2019
55
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def get_presigned_url():
  2. s3 = boto3.client('s3')
  3. bucket = "your-s3-bucket-name"
  4.  
  5. return s3.generate_presigned_post(
  6. Bucket=bucket,
  7. Key="media/screenshots/login.png",
  8. Fields={"acl": "public-read", "Content-Type": "png"},
  9. Conditions=[
  10. {"acl": "public-read"},
  11. {"Content-Type": "png"}
  12. ],
  13. ExpiresIn=3600
  14. )
RAW Paste Data