i am using laravel 6 and i keep getting this error
Unable to guess the MIME type as no guessers are available (have you enable the php_fileinfo extension?).
My Controller :
public function profileData(Request $request)
{
$validate = $request->validate([
$request->file('bannerFile') => 'required',
$request->file('profileFile') => 'required',
$request->input('name') => 'required',
$request->input('bio') => 'required',
$request->input('addr') => 'required',
$request->input('hbd') => 'required',
]);
$bfile = $request->file('bannerFile');
$pfile = $request->file('profileFile');
$nme = $request->input('name');
$bio = $request->input('bio');
$addr = $request->input('addr');
$bd = $request->input('hbd');
$add = Follower::where('user_id',session('id'))->updateOrCreate([
'user_id' => Auth::user()->id,
],[
"bio" => $bio,
"image" => $pcontents,
"banner" => $bcontents,
"birthday" => $hbd,
"address" => $addr,
]);
if ($add) {
return url()->previous();
}
}
My blade :
<div class="modal fade" id="exampleModal2" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-scrollable" style="overflow-x: hidden;">
<div class="modal-content">
<div class="modal-body">
<div class="row">
<form id="picSubmit" action="" method="POST" enctype="multipart/form-data">
@csrf
<label>
<img src="/imgs/camera.svg" style="
cursor: pointer;
position: absolute;
top: 33%;
z-index: 100;
left: 15%;
transform: translate(-50%, -50%);
">
<div>
<img src="/imgs/bg.jpg" style="cursor: pointer;object-fit: cover;width: 495px;height:200px; filter: grayscale(40%);">
</div>
<input type="file" name="bannerFile" class="d-none" style="display: none">
</label>
<label>
<img src="/imgs/camera.svg" style="
cursor: pointer;
position: absolute;
top: 20%;
left: 50%;
transform: translate(-50%, -50%);
">
<div>
<img src="/imgs/avatar-default.png" class="rounded-circle " style="filter: grayscale(40%);cursor: pointer;object-fit: cover;width: 100%;height:150px;border:5px solid white;position: relative;bottom: 100px;">
</div>
<input type="file" name="profileFile" class="d-none" style="display: none">
</label>
<div class="UserDetails container" >
<label>Name</label>
<input type="text" value="" class="form-control" placeholder="Name" name="name">
<br>
<label>Bio</label>
<textarea class="form-control" placeholder="Write Bio" name="bio"></textarea>
<br>
<label>Location</label>
<input type="text" class="form-control" placeholder="Location" name="addr">
<br>
<label>Birthday</label>
<input type="date" class="form-control" name="hbd">
</div>
</form>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" onclick="document.getElementById('picSubmit').submit()" class="btn btn-primary">Save</button>
</div>
</div>
</div>
</div>
i have checked my php ini file which is in xampp/php/php.ini and it is only php.ini file in my whole xampp folder and i have searched php_fileinfo.dll is not there but there is fileinfo extension which is uncommented i've working on this error for a day and still can not get the answer
Thank you
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3089Wga
via IFTTT
Aucun commentaire:
Enregistrer un commentaire