我使用Laravel成功地将一张图片上传到AmazonS3。当我在线检查bucket时,图像就在那里,但是当我点击查看它时,它会给出以下错误:
The webpage at http://.. might be temporarily down or it may have moved permanently to a new web address.
ERR_CONTENT_DECODING_FAILED
以下是我的上传代码:
$imagedata = base64_decode(request('passport'));
$imageFile = Image::make($imagedata)->resize(150, 150)->stream();
$imageFile = $imageFile->__toString();
$filename = str_random(4).str_random(4).str_random(6).'.jpg';
$s3 = \Storage::disk('s3');
$s3->put('images/passport/'.$filename, $imageFile, 'public');
$passport = $s3->url('images/passport/'.$filename);
我也无法在我的页面上查看此图像。
更新
在使用dompdf转换为pdf的视图上,使用存储的URL显示图像。