S3存储桶的内容是没有得到上市到最后 [英] S3 bucket content is not getting listed till last

查看:233
本文介绍了S3存储桶的内容是没有得到上市到最后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始使用foreach循环列出了S3存储桶的内容。

I started listing the contents of a S3 bucket using foreach loop.

$contents = $s3->getBucket("bucket-name");
foreach($contents as $value) 
    {
      print $value['name']; echo "<br>"; 
    }

但问题是,它不高于1000的索引列表。最后几个文件没有列出。 我试图让数组的长度,我发现,过去几年的文件甚至没有得到存储在该数组中。

But the problem is that it is not listing above 1000 index. The last few files are not listing. I tried getting the length of the array and I found that last few files are not even getting stored in that array.

我应该怎么做全部列出来?

What should I do to list them all?

推荐答案

中列出的文件的默认数量设置为1000,所以这就是为什么你不能超过1000个文件:

The default number of listed files is set to 1000, so thats why you cannot get more than 1000 files:

在这里,你有一个函数的说明:

Here you have a description of a function:

public static function getBucket($bucket, $prefix = null, $marker = null, $maxKeys = null, $delimiter = null) {

使用 $标记来设定从哪里开始获取文件和 $ maxKeys 为限。

Use $marker to set where to start getting files and $maxKeys as a limit.

WWW:<一href="http://www.drupalcontrib.org/api/drupal/contributions!media_mover!contrib!mm_s3!S3.php/function/S3%3A%3AgetBucket/6" rel="nofollow">http://www.drupalcontrib.org/api/drupal/contributions!media_mover!contrib!mm_s3!S3.php/function/S3%3A%3AgetBucket/6

如果您使用相同的库。

这篇关于S3存储桶的内容是没有得到上市到最后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆