How retrieve latest file uploaded in a specific s3 bucket folder using php language?

0

I need to retrieve latest file uploaded in a specific s3 bucket folder using php language.

Currently, I'm using "aws/aws-sdk-php" library. I implemented a script that retrieve the full list of files. In order to calculate the latest file date, I must loop for all files.

I need to retrieve latest file uploaded in a specific s3 bucket folder using php language. Currently, I'm using "aws/aws-sdk-php" library. I implemented a script that retrieve the full list of files. In order to calculate the latest file date, I must loop for all files.

Thanks

luk3tt0
질문됨 4달 전272회 조회
1개 답변
0
수락된 답변

Hello.

How about registering S3 object information in DynamoDB etc.?
For example, when a file is put using an S3 trigger, you can start Lambda and register the object creation date, object path, etc. in DynamoDB, and then you can search for the latest object without looping with a PHP script.
https://docs.aws.amazon.com/lambda/latest/dg/with-s3-example.html

profile picture
전문가
답변함 4달 전
profile picture
전문가
검토됨 4달 전
profile pictureAWS
전문가
검토됨 4달 전

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

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

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

관련 콘텐츠