I am trying to post images in the image file format. My Code:
public function store ()
{
$data = request()->validate ([
'caption' => 'required',
'image' => 'required | image | mimes: jpeg, png, jpg, gif, svg | max: 2048'
]);
dd (request()->all());
}
But an error appears:
Unable to guess the mime type as no guessers are available (Did you enable the php_fileinfo extension?).
I learned on StackOverflow enable file info. Meanwhile, I made sure to turn it on and reset it. My PHP version is 7.4 XAMPP 3.2.4.
Thank you, everyone!
I installed xampp which is not suitable for the php version so it failed to install the php_file extension. You just need:
B1: Uninstall current xampp.
B2: Reinstall xampp to match the PHP version.
B3: Turn on the appropriate utilities.
Hope this answer is of help to you!
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments