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
asked 3 months ago235 views
1 Answer
0
Accepted Answer

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
EXPERT
answered 3 months ago
profile picture
EXPERT
reviewed 3 months ago
profile pictureAWS
EXPERT
reviewed 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions