在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而没有到期?
最佳答案
根据最新文档(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.
由于签名本身只能有效七天,因此签名URL无法生效超过七天.拥有永久有效URL的唯一方法是将文件设为公共.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。