Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate file link without expiry?

In AWS S3 how to generate file download url for a file without expiry.

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 url for file without expiry ?

like image 761
Hitul Mistry Avatar asked Oct 04 '22 11:10

Hitul Mistry


1 Answers

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

A presigned URL can be valid for a maximum of seven days because the signing key you use in signature calculation is valid for up to seven days.

Since the signature itself can only be valid for seven days, there's no way for a signed URL to be valid for more than seven days. The only way to have a permanently valid URL is to make the file public.

like image 92
Jason Wadsworth Avatar answered Oct 13 '22 10:10

Jason Wadsworth