diff --git a/app/Helpers/custom.php b/app/Helpers/custom.php
index 4cb7000..3b66f69 100644
--- a/app/Helpers/custom.php
+++ b/app/Helpers/custom.php
@@ -1751,7 +1751,7 @@ if (!function_exists('formKriteria')) {
';
@@ -1776,7 +1776,7 @@ if (!function_exists('formKriteria')) {
';
diff --git a/app/Http/Controllers/StorageController.php b/app/Http/Controllers/StorageController.php
index 8135558..e4ab917 100644
--- a/app/Http/Controllers/StorageController.php
+++ b/app/Http/Controllers/StorageController.php
@@ -30,6 +30,8 @@ class StorageController extends Controller
}
function fileasset(){
$path = request('path');
+ $type = request('type');
+ $content = 'inline';
try {
// 🔍 cek dulu file ada atau tidak
@@ -37,6 +39,12 @@ class StorageController extends Controller
abort(404, 'File tidak ditemukan');
}
+ if (@$type == 'download'){
+ $content = 'attachment';
+ }else{
+ $content = 'inline';
+ }
+
$expl = explode('.',$path);
if($expl[1] == 'pdf'){
@@ -63,7 +71,7 @@ class StorageController extends Controller
}
}, 200, [
'Content-Type' => $mime,
- 'Content-Disposition' => 'inline; filename="'.basename($path).'"',
+ 'Content-Disposition' => $content.'; filename="'.basename($path).'"',
'X-Content-Type-Options' => 'nosniff',
]);