@shiva You might want to verify that your "file" is not being sent as an array of files. Especially when using dropzone, I've found often that what I initially expect to be able to use $file for, I actually need to use $file[0] for. Maybe dd'ing Input::file('file) would be a good place to start so you can see what you're working with.
Mar 21, 2017
13
Level 5
Call to a member function getClientOriginalName() on null
I'm creating a form that uses dropzone.js, but I'm trying to save the filename to my database. When I submit I get this error
Call to a member function getClientOriginalName() on null
This is my function
public function imageTest(){
$menu = new Menu;
$input = Input::all();
$file = Input::file('file');
$destinationPath = 'menu_images';
$filename = $file->getClientOriginalName();
$upload_success = Input::file('file')->move($destinationPath, $filename);
echo "<PRE>";
print_r($filename);
die();
}
Please or to participate in this conversation.