我想在R中使用'paws'包完成此操作:
import boto3
url = boto3.client('s3').generate_presigned_url(
ClientMethod='get_object',
Params={'Bucket': 'BUCKET_NAME', 'Key': 'OBJECT_KEY'},
ExpiresIn=3600)
从:https://docs.aws.amazon.com/AmazonS3/latest/userguide/ShareObjectPreSignedURL.html
有人知道怎么做吗?谢谢! !
在最新版本的paws 0.2.0中添加了此功能。目前在此回复时,爪子0.2.0还没有发布到cran。但是,您可以使用以下命令从r-universe安装它:
# Enable repository from paws-r
options(repos = c(
pawsr = 'https://paws-r.r-universe.dev',
CRAN = 'https://cloud.r-project.org'))
# Download and install paws in R
install.packages('paws')
paws::s3()$generate_presigned_url(
client_method='get_object',
params=list(Bucket='BUCKET_NAME', Key='OBJECT_KEY'),
expires_in=3600
)
我希望这对你有帮助:)