Amazon S3 Aws - Generate signed object download URLs
This python code generates signed URL to download a private file from Amazon S3 storage, invoking boto API.
Note that this generates a signed download URL for secret_plans.txt that will work for 1 hour (3600 seconds).
Signed download URLs will work for the time period even if the object is private (when the time period is up, the URL will stop working).
post this code
# Get the private key reference to secret_plans.txt file
plans_key = bucket.get_key('secret_plans.txt')
# Generate a signed URL, timer is set to 1 hour
plans_url = plans_key.generate_url(3600, query_auth=True, force_http=True)
If you want to be updated about similar snippets,
and follow our Channels