[英]Enable the php_fileinfo extension?
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?).
无法猜测 mime 类型,因为没有可用的猜测器(您是否启用了 php_fileinfo 扩展?)。
I learned on StackOverflow enable file info.我在 StackOverflow 上了解到启用文件信息。 Meanwhile, I made sure to turn it on and reset it.
同时,我确保将其打开并重置。 My PHP version is
7.4 XAMPP 3.2.4.
我的 PHP 版本是
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.我安装了不适合php版本的xampp,所以安装php_file扩展失败。 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!希望这个回答对你有帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.