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
preguntada hace 4 meses272 visualizaciones
1 Respuesta
0
Respuesta aceptada

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
EXPERTO
respondido hace 4 meses
profile picture
EXPERTO
revisado hace 4 meses
profile pictureAWS
EXPERTO
revisado hace 4 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas