📅  最后修改于: 2022-03-11 14:58:01.131000             🧑  作者: Mango
Add this function ob_end_clean(); after set header
=> Example :
$get_document = 'assets/documents/'.$id.'/' . $file;
if (Storage::disk('s3')->exists($get_document)) {
$file_name = $file;
$type = $type;
$headers = [
'Content-Type' => 'application/'.$type,
'Content-Disposition' => 'attachment; filename="'. $file_name .'"',
];
ob_end_clean();
return \Response::make(Storage::disk('s3')->get($get_document), 200, $headers);
}