php - AWS S3 ListObjectsV2 returns full list of files with MaxKeys set only to 10 -


i'm trying implement s3 client in php lists 10 files @ time through pagination feature. accomplish this, per api doc, i'm making following call:

$result = $this->s3->getpaginator('listobjectsv2', [             'bucket'       => 'my_s3_bucket_name',             'delimiter'    => '/',             'maxkeys'      => 10,             'startafter'   => urlencode($_session['prev_key'])         ]); 

and using jmespath expression extract subset of data need display. above seems "work" seems retrieve json set child subsets containing 10 files each. in other words, if had 26 files stored on bucket, i'd 26 files in 3 subsets of array--all in single request. obviously, s3 has been around long time , i'm sure there's best practice i'm trying achieve. however, i've searched past few days no avail. if point me in right direction pls...

the point of paginator -- doing pagination necessary fetch full result.

and you're using it, done in sets of 10.

if want make specific request, show here, don't use paginator, use listobjectsv2 directly.

also, doubt it's appropriate or necessary urlencode() previous key. sdk should if needed.


Comments

Popular posts from this blog

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -