* Use helper::header() instead of header().

This commit is contained in:
朱金勇
2023-07-03 15:26:08 +00:00
parent 3fd6df05e8
commit a3c848d7af
12 changed files with 684 additions and 26 deletions
+4 -4
View File
@@ -1088,10 +1088,10 @@ class fileModel extends model
$mimes = $this->config->file->mimes;
$contentType = isset($mimes[$fileType]) ? $mimes[$fileType] : $mimes['default'];
header("Content-type: $contentType");
header("Content-Disposition: attachment; filename=\"$fileName\"");
header("Pragma: no-cache");
header("Expires: 0");
helper::header('Content-type', $contentType);
helper::header('Content-Disposition', "attachment; filename=\"$fileName\"");
helper::header('Pragma', 'no-cache');
helper::header('Expires', '0');
if($type == 'content') helper::end($content);
if($type == 'file' and file_exists($content))
{