python - 如何为 S3 存储桶中的对象(JSON 文件)创建可下载的 URL?
问题描述
我有一个对象保存在 s3 存储桶中。我想为该对象创建一个可下载的 URL。我用generate_presigned_url
, 作为:
s3_client = boto3.client('s3')
json_url = s3_client.generate_presigned_url('get_object',
Params={'Bucket': <bucket_name>, 'Key': <json_file>}, ExpiresIn=86400)
但是,当我单击提供的 url 时,我收到以下错误:
<Error>
<Code> SignatureDoesNotMatch </Code>
<Message> The request signature we calculated does not match the signature you provided. Check your key and signing method. ...
...
</Error>
任何想法?
解决方案
推荐阅读
- c# - OData IQueryable 是异步的吗?
- node.js - 使用 Lambda 的测试功能进行测试时获得响应“Null”
- reactjs - 渲染 html 字符串时的 react-native-webview 性能问题
- python - Python:将字符串转换为八位字节格式
- php - 如何从 2 个不同的表中选择并插入到 1 个表
- javascript - 为什么 Node.js 只识别绝对路径?
- javascript - 更改标题只保存几秒钟(直到页面停止加载)
- django - 位置参数的 Django Rest API 类型错误
- powershell - 创建由 CPU 负载百分比触发的事件侦听器
- c# - 如何根据表 A 中列 A 的结果更新表 B 中的列 b