Moj*_*ojo 0 cloud amazon-s3 amazon-web-services
我在AWS S3存储桶中上传了少量图像,并具有公共访问权限.我需要这些网址,有没有办法做到这一点,而不是一个接一个地手动?
使用您自己的程序很容易,这是一个带https://github.com/minio/minio-py库的示例程序.
如果您知道已将其上传到哪个前缀,则可以使用前缀分隔符列出它们.
from minio import Minio
client = Minio('https://s3.amazonaws.com',
access_key='**************',
secret_key='**************')
# List all object paths in bucket that begin with hello.
objects = client.list_objects('your-bucket', prefix='your-prefix',
recursive=True)
for obj in objects:
url = 'https://{0}.s3.amazonaws.com/{1}'.format(obj.bucket_name,
obj.object_name.encode('utf-8'))
print(url)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
669 次 |
| 最近记录: |