作者 lyh

gx

... ... @@ -343,12 +343,9 @@ class FileController
$this->response('指定文件不存在!', Code::USER_ERROR);
}
$fileUrl = getFileUrl($info['path'],$info['is_cos']);
// $fileName = basename($fileUrl); // 要保存的文件名
// 设置响应头
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($info['name'], true) . PHP_EOL, FILE_APPEND);
// header('Content-Disposition: attachment; filename="' . !empty($info['name']) ? $info['name'] : '未命名'.basename($info['path']) . '"');
$name = !empty($info['name']) ? $info['name'] : '未命名'.basename($info['path']);
header('Content-Disposition: attachment; filename="'.$name.'"');
// 下载文件
... ...