Python 如何生成文件链接而不过期?

Python 如何生成文件链接而不过期?,python,amazon-web-services,amazon-s3,amazon-ec2,boto,Python,Amazon Web Services,Amazon S3,Amazon Ec2,Boto,在AWS S3中,如何为文件生成文件下载url而不过期 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) pri

在AWS S3中,如何为文件生成文件下载url而不过期

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

如何在不过期的情况下为文件生成url?

链接过期是为了在不公开身份验证密钥的情况下允许对私有文件进行有限的访问


如果要使文件始终可用,请将文件公开,或向其他s3用户提供权限。

根据最新文档():

预签名的URL的有效期最长为七天,因为 您在签名计算中使用的签名密钥的有效期最多为七天 天

由于签名本身只能在七天内有效,因此签名URL的有效期不可能超过七天。拥有永久有效URL的唯一方法是将文件公开