From 2c6b80c3450f1fbaf545d5cd859171d72b7e29de Mon Sep 17 00:00:00 2001 From: "afiq.hamzah" Date: Sun, 27 Nov 2022 10:59:34 +0800 Subject: [PATCH] Fix render file compatibility with server OS --- app/Services/MarhunPhotoService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Services/MarhunPhotoService.php b/app/Services/MarhunPhotoService.php index 802ebdf9..03a534be 100644 --- a/app/Services/MarhunPhotoService.php +++ b/app/Services/MarhunPhotoService.php @@ -84,8 +84,8 @@ class MarhunPhotoService $filePath = Storage::disk('marhun')->path("{$directory}${marhunImageFileName}"); - header('Content-Type:' . $imageExtension); - header('Content-Length: ' . filesize($filePath)); + header('Content-Type: ' . mime_content_type($filePath)); + header('Content-Disposition: inline; filename="'.basename($filePath).'"'); readfile($filePath); } }