Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

181
Visualizações
AWS S3 ListObjectsV2 returns full list of files with MaxKeys set only to 10

I'm trying to implement S3 client in PHP that lists only 10 files at a time through pagination feature. To accomplish this, as per the 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 to extract the subset of data that i need to display. The above seems to "work" but it seems to retrieve JSON set with child subsets containing 10 files each. In other words, if i had 26 files stored on my bucket, i'd get all 26 files in 3 subsets of array--all in single request. Obviously, S3 has been around long time and i'm sure there's a best practice for what i'm trying to achieve. However, i've searched for past few days to no avail. If anyone could point me in the right direction pls...

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

The point of the paginator is to get everything -- doing the pagination necessary to fetch the full result.

And as you're using it, it would be done in sets of 10.

If you want to make a specific request, like you show here, don't use the paginator, just use ListObjectsV2 directly.

Also, I doubt that it's appropriate or necessary to urlencode() the previous key. The SDK should do it for you if needed.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda