正在显示
1 个修改的文件
包含
0 行增加
和
3 行删除
| @@ -343,12 +343,9 @@ class FileController | @@ -343,12 +343,9 @@ class FileController | ||
| 343 | $this->response('指定文件不存在!', Code::USER_ERROR); | 343 | $this->response('指定文件不存在!', Code::USER_ERROR); |
| 344 | } | 344 | } |
| 345 | $fileUrl = getFileUrl($info['path'],$info['is_cos']); | 345 | $fileUrl = getFileUrl($info['path'],$info['is_cos']); |
| 346 | -// $fileName = basename($fileUrl); // 要保存的文件名 | ||
| 347 | // 设置响应头 | 346 | // 设置响应头 |
| 348 | header('Content-Description: File Transfer'); | 347 | header('Content-Description: File Transfer'); |
| 349 | header('Content-Type: application/octet-stream'); | 348 | header('Content-Type: application/octet-stream'); |
| 350 | - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($info['name'], true) . PHP_EOL, FILE_APPEND); | ||
| 351 | -// header('Content-Disposition: attachment; filename="' . !empty($info['name']) ? $info['name'] : '未命名'.basename($info['path']) . '"'); | ||
| 352 | $name = !empty($info['name']) ? $info['name'] : '未命名'.basename($info['path']); | 349 | $name = !empty($info['name']) ? $info['name'] : '未命名'.basename($info['path']); |
| 353 | header('Content-Disposition: attachment; filename="'.$name.'"'); | 350 | header('Content-Disposition: attachment; filename="'.$name.'"'); |
| 354 | // 下载文件 | 351 | // 下载文件 |
-
请 注册 或 登录 后发表评论