From e15d618aeae8b8dc3438a00b17f4ae523d8b686b Mon Sep 17 00:00:00 2001 From: bbbboom Date: Thu, 1 Feb 2024 16:59:38 +0800 Subject: [PATCH] Fix download file name error Fixed the problem of no file name when downloading using public links. --- app/function/file.function.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/function/file.function.php b/app/function/file.function.php index a6f38602..d40ed550 100755 --- a/app/function/file.function.php +++ b/app/function/file.function.php @@ -1007,7 +1007,7 @@ function file_put_out($file,$download=-1,$downFilename=false){ header('Content-Disposition: attachment;filename='.$headerName); }else{ header('Content-Type: '.$mime); - //header('Content-Disposition: inline;filename='.$headerName); + header('Content-Disposition: inline;filename='.$headerName); if(strstr($mime,'text/')){ //$charset = get_charset(file_get_contents($file)); header('Content-Type: '.$mime.'; charset=');//避免自动追加utf8导致gbk网页乱码 @@ -1503,4 +1503,4 @@ function write_log($log, $type = 'default', $level = 'log'){ } clearstatcache(); return error_log("$now_time $log\n", 3, $target); -} \ No newline at end of file +}