![](/img/trans.png)
[英]How do I create a Presigned URL to download a file from an S3 Bucket using Boto3?
[英]How to generate S3 presigned URL with boto3 resource instead of client
我嘗試重構使用s3 = boto3.resource('s3')
(什么是資源)作為 S3 實例的應用程序。
但是只有Client
class有generate_presigned_url
方法。 那么,如何使用resource
預簽名 URL 呢?
您可以通過這種方式訪問與資源關聯的客戶端:
s3 = boto3.resource('s3')
url = s3.meta.client.generate_presigned_url(...)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.