Search files via PHP SDK filtering with limit and date

0

I need to search files on AWS S3 storage using some filter:

  • range date
  • storage class
  • num max items

I'm using "aws/aws-sdk-php" : "^3.239" library

$objects = $this->client->getIterator('ListObjects', [
				'Bucket' => S3_BUCKET_NAME,
				'Prefix' => $folder,
				'MaxKeys' => 10,	// NOT WORKS
				'StorageClass' => "STANDARD"	// NOT WORKS
		]);

		foreach ($objects as $object) {	
			...
		}

Could you please support me?

Thanks L

luk3tt0
질문됨 2년 전564회 조회
1개 답변
0

The Iterator method is for the php V2. If you are using PHP V3, could you try with the paginator. A Paginator is essentially an iterator of results. They are created via the getPaginator() method of the client.

Resources for review: [1]: https://docs.aws.amazon.com/zh_cn/aws-sdk-php/guide/latest/guide/paginators.html [2]: https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-Aws.AwsClientInterface.html#_getPaginator [3]: https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-s3-2006-03-01.html#listobjects

AWS
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인