精品课程   更多>>

★★★★★ 952人浏览

★★★★★ 938人浏览

★★★★★ 855人浏览

★★★★★ 1125人浏览

★★★★★ 1001人浏览

★★★★★ 986人浏览

★★★★ 864人浏览

培训报名   更多>>

★★★★★ 9967人浏览

★★★★★ 6254人浏览

★★★★★ 6987人浏览

★★★★★ 3568人浏览

★★★★★ 4637人浏览

★★★★★ 6245人浏览

★★★★★ 25651人浏览

★★★★★ 6897人浏览

学员风采更多>>

学校环境更多>>

客服咨询

在线咨询

客服1:1986150154

客服2:421248028

服务热线

服务热线

0598-8288801

0598-8288802

官方微信

官方微信

0.043429s
系统发生错误

[2] ErrorException in CommonController.php line 79

Cannot modify header information - headers already sent by (output started at /www/wwwroot/site.57kjpx.com/runtime/classmap.php:688)

  1. $savePath = $savepath . $attachment['file_path'];
  2. // 检查文件是否存在
  3. if (! file_exists($savePath) ) {
  4. $this->error('文件未找到');
  5. }else{
  6. // 打开文件
  7. $file1 = fopen($savePath, "r");
  8. // 输入文件标签
  9. Header("Content-type: application/octet-stream");
  10. Header("Accept-Ranges: bytes");
  11. Header("Accept-Length:".filesize($savePath));
  12. Header("Content-Disposition: attachment;filename=" . $fileName);
  13. ob_clean(); // 重点!!!
  14. flush(); // 重点!!!!可以清除文件中多余的路径名以及解决乱码的问题:
  15. //输出文件内容
  16. //读取文件内容并直接输出到浏览器
  17. echo fread($file1, filesize($savePath));
  18. fclose($file1);

Call Stack

  1. in CommonController.php line 79
  2. at Error::appError(2, 'Cannot modify header...', '/www/wwwroot/site.57...', 79, ['id' => '10', 'attachment' => ['id' => 10, 'type' => 1, 'file_name' => '...', ...], 'savepath' => '/www/wwwroot/site.57...', ...])
  3. at header('Content-type: applic...') in CommonController.php line 79
  4. at CommonController->attachment('10')
  5. at ReflectionMethod->invokeArgs(object(CommonController), ['10']) in Container.php line 372
  6. at Container->invokeReflectMethod(object(CommonController), object(ReflectionMethod), ['id' => '10']) in Module.php line 129
  7. at Module->think\route\dispatch\{closure}(object(Request), object(Closure), null)
  8. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 176
  9. at Middleware->think\{closure}(object(Request))
  10. at call_user_func(object(Closure), object(Request)) in Middleware.php line 121
  11. at Middleware->dispatch(object(Request), 'controller') in Module.php line 134
  12. at Module->exec() in Dispatch.php line 167
  13. at Dispatch->run() in App.php line 432
  14. at App->think\{closure}(object(Request), object(Closure), null)
  15. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 176
  16. at Middleware->think\{closure}(object(Request))
  17. at call_user_func(object(Closure), object(Request)) in Middleware.php line 121
  18. at Middleware->dispatch(object(Request)) in App.php line 435
  19. at App->run() in index.php line 21

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
FCGI_ROLE RESPONDER
SCRIPT_FILENAME /www/wwwroot/site.57kjpx.com/public/index.php
QUERY_STRING s=/attachment-10.html
REQUEST_METHOD GET
CONTENT_TYPE
CONTENT_LENGTH
SCRIPT_NAME /index.php
REQUEST_URI /attachment-10.html
DOCUMENT_URI /index.php
DOCUMENT_ROOT /www/wwwroot/site.57kjpx.com/public
SERVER_PROTOCOL HTTP/1.1
REQUEST_SCHEME http
GATEWAY_INTERFACE CGI/1.1
SERVER_SOFTWARE nginx/1.14.2
REMOTE_ADDR 216.73.216.36
REMOTE_PORT 32391
SERVER_ADDR 172.17.42.171
SERVER_PORT 80
SERVER_NAME www.57kjpx.com
REDIRECT_STATUS 200
PATH_INFO
HTTP_ACCEPT */*
HTTP_USER_AGENT Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
HTTP_ACCEPT_ENCODING gzip, br, zstd, deflate
HTTP_HOST www.57kjpx.com
HTTP_VIA 1.1 squid-proxy-5b5d847c96-ktsfj (squid/6.10)
HTTP_X_FORWARDED_FOR 10.2.4.238
HTTP_CACHE_CONTROL max-age=259200
HTTP_CONNECTION keep-alive
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1750199586.2962
REQUEST_TIME 1750199586
Environment Variablesempty
ThinkPHP Constantsempty
0.034961s