作者 lyh

gx

@@ -349,7 +349,8 @@ class FileController @@ -349,7 +349,8 @@ class FileController
349 header('Content-Type: application/octet-stream'); 349 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); 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']) . '"'); 351 // header('Content-Disposition: attachment; filename="' . !empty($info['name']) ? $info['name'] : '未命名'.basename($info['path']) . '"');
352 - header('Content-Disposition: attachment; filename="index.pdf"'); 352 + $name = !empty($info['name']) ? $info['name'] : '未命名'.basename($info['path']);
  353 + header('Content-Disposition: attachment; filename="'.$name.'"');
353 // 下载文件 354 // 下载文件
354 readfile($fileUrl); 355 readfile($fileUrl);
355 } 356 }