dongtang1966
dongtang1966
2016-02-18 13:16
浏览 171
已采纳

在S3中生成下载文件夹的链接

I have setup website where you can send files to Amazon S3 cloud storage. Multiple files can be stored in folders like so:

my_bucket/folder1/file1.txt

my_bucket/folder1/file2.txt

Now I am trying to generate link for user to download whole folder1 which I found weirdly hard to do. Is there something I am missing? Trying to generate url using getObjectUrl("mybucket", "folder1") for folder1 is giving me error.

Also is there a way I could make generated URL not to look like this:

https://my_bucket.s3.amazonaws.com/file1.txt

but something that is more appropriate for a general public usage?

图片转代码服务由CSDN问答提供 功能建议

我有安装网站,您可以在其中将文件发送到Amazon S3云存储。 多个文件可以存储在文件夹中,如下所示:

my_bucket / folder1 / file1.txt

my_bucket /folder1/file2.txt

nn

现在我正在尝试生成用户下载整个 folder1 的链接,我发现这很难做到。 有什么我想念的吗? 尝试使用 getObjectUrl(“mybucket”,“folder1”) folder1 生成网址给我一个错误。

也有 我可以使生成的网址看起来像这样:

https://my_bucket.s3.amazonaws.com/file1.txt < / code>

但更适合一般公众使用的东西?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • douzhao4071
    douzhao4071 2016-02-18 15:04
    已采纳

    S3 does not have this feature. You would need to zip up all the files you want to provide a link for, put the zip file on S3, and then generate a link to that.

    点赞 评论

相关推荐