Skip to content

Commit

Permalink
Update File.php
Browse files Browse the repository at this point in the history
优化文件下载在不同浏览器中的兼容性
  • Loading branch information
xieyongfa123 authored and liu21st committed Oct 7, 2024
1 parent d6540b9 commit 174beda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/think/response/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ protected function output($data)
$this->header['Pragma'] = 'public';
$this->header['Content-Type'] = $mimeType ?: 'application/octet-stream';
$this->header['Cache-control'] = 'max-age=' . $this->expire;
$this->header['Content-Disposition'] = ($this->force ? 'attachment; ' : '') . "filename* = UTF-8''{$name}";
$this->header['Content-Disposition'] = ($this->force ? 'attachment; ' : '') . 'filename="' . $name . '";' . "filename* = UTF-8''{$name}";
$this->header['Content-Length'] = $size;
$this->header['Content-Transfer-Encoding'] = 'binary';
$this->header['Expires'] = gmdate("D, d M Y H:i:s", time() + $this->expire) . ' GMT';
Expand Down

0 comments on commit 174beda

Please sign in to comment.