如何从Laravel背包将图像上传到S3

时间:2018-07-02 10:12:06

标签: laravel amazon-web-services amazon-s3 backpack-for-laravel

我创建了现场图像和设置参数,用于将图像上传到s3磁盘。

$this->crud->addField([ // image
        'label' => "Profile Image",
        'name' => "image_name",
        'type' => 'image',
        'upload' => true,
        'crop' => true, // set to true to allow cropping, false to disable
        'aspect_ratio' => 2.07, // ommit or set to 0 to allow any aspect ratio
        //'disk' => 'local',
        //'prefix' => 'uploads/images/profile_pictures/' // in case you only store the filename in the database, this text will be prepended to the database value
        'disk' => 's3',
        'prefix' => 'strains/',
    ]);

当我设置本地磁盘时,它工作正常。但是在控制台中使用s3时,会收到消息:

获取https://s3.eu-central-1.amazonaws.com/greenery-map-sra/strains/c65020660af697446675ddf9e657a0e7.jpg 404(未找到) 编辑:595

跨源读取阻止(CORB)阻止了跨源响应 https://s3.eu-central-1.amazonaws.com/greenery-map-sra/strains/c65020660af697446675ddf9e657a0e7.jpg,MIME类型为application / xml。有关更多详细信息,请参见https://www.chromestatus.com/feature/5629709824032768

图片没有在文件夹中上传/

如何解决?

0 个答案:

没有答案
相关问题