Fix download file name error

Fixed the problem of no file name when downloading using public links.
pull/530/head
bbbboom 2024-02-01 16:59:38 +08:00 committed by GitHub
parent 5cf233f755
commit e15d618aea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -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);
}
}