Can you post your controller method?
Apr 28, 2021
14
Level 8
File Upload
I am adding input type file using jQuery like below.
$("#company_logo .ri-close-line").click(function() {
$("#company_logo").html('<input type="file" class="form-control-file" name="company_logo" />');
});
My Form has multipart option like below
<form action="{{ route('update_profile') }}" method="POST"
enctype="multipart/form-data">
@csrf
<div class="form-group">
<label for="exampleFormControlFile1">Company Logo</label>
<div id="company_logo">
@if ($profile_data['company_logo'])
<img src="https://sometext" height="100" width="100" />
<i class="ri-close-line" title="Click to Update Image"></i>
@else
<input type="file" class="form-control-file" name="company_logo" />
@endif
</div>
</div>
My controller function is like below
public function update_profile(Request $request)
{
dd($request->file('company_logo'));
}
I am getting output like below

But when I am debugging in controller (dd($request);) I am getting empty output like below.

Please or to participate in this conversation.

