小编Luc*_*uca的帖子

BOTO3 - generate_presigned_url for `put_object` return `The request signature we calculated does not match the signature you provided`

I'm trying to create a presigned url that will help some customers to upload files . Here my test script that is currently working

# 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))
Run Code Online (Sandbox Code Playgroud)

But if I'm adding:

`ACL': 'public-read' 
Run Code Online (Sandbox Code Playgroud)

to Params (or add some metadata following the information in the put_object documentation …

python amazon-s3 amazon-web-services boto3

5
推荐指数
2
解决办法
8898
查看次数

标签 统计

amazon-s3 ×1

amazon-web-services ×1

boto3 ×1

python ×1