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 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南