How to create a link to a file without expiration?

In AWS S3, how to generate a file to download a file without expiration.

conn = boto.connect_s3(awsAccessKey, awsSecret) # Get bucket instance. bucket = conn.get_bucket(bktName) fileKey = bucket.get_key(fileKey) url = fileKey.generate_url(expires_in=None, query_auth=True, force_http=True) print url 

How to generate file url without expiration?

+4
source share
2 answers

According to the latest docs ( http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html ):

The assigned URL can be valid for no more than seven days, because the signature key that you use to calculate the signature is valid for up to seven days.

Since the signature itself can only be valid for seven days, it is not possible for the signed URL to be valid for more than seven days. The only way to have a permanent valid URL is to make the file public.

+3
source

The validity period of a link is to allow limited access to private files without exposing authentication keys.

If you want to make the file always accessible, make the file public or grant permissions to other s3 users.

-one
source

Source: https://habr.com/ru/post/1493162/


All Articles