I'm trying to make an image uploader, but it always give me this error
Call to a member function getClientOriginalName() on a non-object here is my code controller code
public function postSubtitle()
{
//$video = Video::where('user_id', '=', Auth::id())->find(Input::all('id'));
var_dump(Input::all());
$file= Input::file('name');
echo $file->getClientOriginalExtension();
}
and here is the upload form
{{ form_open({'url': 'video/subtitle', 'files': 'true'}) }}
{{ form_file('name', {class: 'form-control'} ) }}
{{ form_submit(trans('main.edit'), {class: 'btn btn-lg btn-success btn-block'}) }}
{{form_close()}}
what's wrong with my code?