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

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ