背包文件上传Laravel验证失败

问题描述 投票:0回答:1

目前,我想将图像上传到现有项目。这些是我的字段的属性:

        [
            'label' => __('admin.product_image'),
            'name' => "product_image",
            'type' => 'image',
            'upload' => true,
            'disk' => 'uploads'
        ],

在我的表单请求类中:

        'product_image' => 'nullable|file',

如果我取消验证并且从请求中添加了我的'product_image',我会得到这个:

https://prnt.sc/syx3ya

请有人可以帮助我找到我所缺少的吗?

php laravel laravel-7 backpack-for-laravel
1个回答
0
投票

默认情况下,背包将文件转换为base64字符串,并且文件验证器失败,因为属性包含字符串,而不是文件。

© www.soinside.com 2019 - 2024. All rights reserved.