创建如此的S3客户端时:
s3 = boto3.client(
's3',
endpoint_url=app.config['S3_HOST'],
aws_access_key_id=app.config['S3_SETTINGS']['accessKey'],
aws_secret_access_key=app.config['S3_SETTINGS']['sharedSecret'],
config=Config(signature_version='s3')
)
然后尝试上传文件:
s3.upload_fileobj(Fileobj=_file,
Bucket=app.config['S3_BUCKET'],
Key=file_hash,
ExtraArgs={
"Metadata": {
"file_name": file_name
}
})
它抛出"Error: The request signature we calculated does not match the signature you provided. Check your key and signing method."
s3v4似乎也不起作用。我应该使用什么签名版本?