我创建了现场图像和设置参数,用于将图像上传到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。
图片没有在文件夹中上传/
如何解决?