Support the ongoing development of Laravel.io →
posted 10 years ago
Input
Last updated 2 years 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 2 years 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 2 years ago.
0

Like @eriktisme said that fixed the problem.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

lstables lstables Joined 5 Jan 2014

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.