From 7731e77c25c925295c7147e9ff3655d9a7f9153c Mon Sep 17 00:00:00 2001 From: sunhao Date: Tue, 15 Jul 2025 12:42:24 +0800 Subject: [PATCH] * [bug #63818] fix download file with file-ajaxQuery without file name. --- module/file/control.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/file/control.php b/module/file/control.php index bc212fabe3..b449879bd3 100755 --- a/module/file/control.php +++ b/module/file/control.php @@ -578,7 +578,7 @@ class file extends control } $fileID = $file->id; - if(helper::isAjaxRequest() || (isset($_SERVER['HTTP_SEC_FETCH_MODE']) && in_array($_SERVER['HTTP_SEC_FETCH_MODE'], array('cors', 'same-origin')))) return $this->fetch('file', 'read', "fileID=$fileID&stream=$stream"); + if($stream) return $this->fetch('file', 'read', "fileID=$fileID&stream=$stream"); return $this->fetch('file', 'download', "fileID=$fileID"); } http_response_code(404); @@ -596,7 +596,7 @@ class file extends control } $fileID = $file->id; - if(helper::isAjaxRequest() || (isset($_SERVER['HTTP_SEC_FETCH_MODE']) && in_array($_SERVER['HTTP_SEC_FETCH_MODE'], array('cors', 'same-origin')))) return $this->fetch('file', 'read', "fileID=$fileID&stream=$stream"); + if($stream) return $this->fetch('file', 'read', "fileID=$fileID&stream=$stream"); return $this->fetch('file', 'download', "fileID=$fileID"); }