what is wrong with my code? when I watch the preview in inspect element in the browser, I can see the image in the preview section. but the image is not downloading.
$name = $result['name'];
$path = $result['path'];
$disposition = HeaderUtils::makeDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT,
$name,
str_replace('%', '', Str::ascii($name)));
return \Response::download($path, $name, [
'Content-Type' => 'image/png',
'Content-Disposition' => $disposition
]);
browser response headers are here
Accept-Ranges: none
Cache-Control: public
Connection: close
Content-Disposition: attachment; filename=e7853e60982911eb912b2192bf4aa5360341.png
Content-Length: 5095
Content-Type: image/png