Support the ongoing development of Laravel.io →
Input
Last updated 3 months ago.
0

You are probably getting this because files is an array. ( files[] ) Maybe this will fix the problem.

$files = Input::file('files');

foreach ( $files as $file ) {
    $name = $file->getClientOriginalName();

    echo $name . '<br>';
}
Last updated 3 months ago.
0

You can try to debug a bit on your own first. If it's telling you $file is a non-object, the first question that should come to your mind is: What the heck is $file then? Laravel has a nice helper function for debugging:

dd($file);
Last updated 3 months ago.
0

Like @eriktisme said that fixed the problem.

Last updated 3 months ago.
0

Sign in to participate in this thread!

LaraJobs

Your banner here too?

lstables lstables lstables Joined 5 Jan 2014

Moderators

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

Your logo here?

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

© 2022 Laravel.io - All rights reserved.