【发布时间】:2018-10-03 11:12:55
【问题描述】:
我正在尝试创建一个预签名的 url 来帮助一些客户上传文件。 这是我当前正在运行的测试脚本
# Get the service client.
s3 = boto3.client('s3')
boto3.set_stream_logger(name='botocore')
# Generate the URL to get 'key-name' from 'bucket-name'
url = s3.generate_presigned_url(
ClientMethod='put_object',
Params={
'Bucket': s3_bucket_name,
'Key': test_key,
}
)
files = StringIO("asdfasdfasdf")
response = requests.put(url, data=files)
print(str(response.content))
但如果我要添加:
`ACL': 'public-read'
到Params(或在我从服务器收到的put_object documentation 中的信息之后添加一些元数据:
The request signature we calculated does not match the signature you provided. Check your key and signing method.
我还打开了一个关于 BOTO3 的问题: https://github.com/boto/boto3/issues/1722
【问题讨论】:
标签: python amazon-web-services amazon-s3 boto3