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
最佳答案
根据最新文档(http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html):
原文链接:https://www.f2er.com/python/439580.htmlA 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.