Level 1
Fixed using
enctype="multipart/form-data"
Hi , i'm having an issue with image upload . I can select the file , then it automatically submits the form . However when i try to access the image in my controller - its getting null.
<form class="form-horizontal" role="form" name="upload-form" method="POST" files=true action="{{ url('/upload') }}">
<input type="file" name="image" onchange="this.form.submit()"/>
<form>
Question 1 , should i use
files=true or files="true" ? (tried both - same error)
In my controller :
$file = $request->file('image');
$img_ex = $file->getClientOriginalExtension();
getting error :
Call to a member function getClientOriginalExtension() on null
Fixed using
enctype="multipart/form-data"
Please or to participate in this conversation.