Level 75
@carleogden With allFiles
foreach (\Storage::disk('s3')->allFiles($url) as $file) {
// your file is in $file
}
Documentation: https://laravel.com/docs/7.x/filesystem#directories
1 like
Hi
I have the following code:
$url = \AmazonS3Helpers::getPath('agency',$agency_id,'Media');
try {
$exists = \Storage::disk('s3')->exists($url);
} catch (Exception $e) {
# An error occurs communicating with S3, for now, assume the image exists
# $exists = true;
}
I need to get list all the files in a folder on Amazon S3, I know the above verifies that this folder exists, how do i get a listing back? I can't seem to work out if there is a function to do this!
Kind regards in advance Carl.
@carleogden With allFiles
foreach (\Storage::disk('s3')->allFiles($url) as $file) {
// your file is in $file
}
Documentation: https://laravel.com/docs/7.x/filesystem#directories
Please or to participate in this conversation.