Support the ongoing development of Laravel.io →
posted 1 year ago
Last updated 1 year ago.
0
Solution

You need to change the way you are getting the files from the public folder.

Below is the working solution for your problem.

    foreach (File::glob(public_path() . '/images/nodes/*.jpg*') as $filename) {
       echo "$filename size " . filesize($filename) . "\n";
}

The above code snippet will get all the files from the nodes folder with .jpg extensions.

g10rg liked this reply

1
Solution selected by @g10rg

Sign in to participate in this thread!

Eventy

Your banner here too?

andrea g10rg Joined 26 May 2022

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.