From 8484cddba077d981760789a6ff6cdfed09879160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 9 Mar 2021 19:16:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HttpServer/Http/Response.php | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/HttpServer/Http/Response.php b/HttpServer/Http/Response.php index ba3f6a56..71b21ef9 100644 --- a/HttpServer/Http/Response.php +++ b/HttpServer/Http/Response.php @@ -304,19 +304,21 @@ class Response extends HttpService // $this->response->setHeader('Content-Disposition', ' attachment; filename="' . end($name) . '"'); // $this->response->gzip(5); - while ($file = fread($open, $limit)) { - $this->response->write($file); - fseek($open, $offset); - if ($sleep > 0) { - sleep($sleep); - } - if ($offset >= $stat['size']) { - break; - } - $offset += $limit; - } - - $this->response->end(); + $this->response->sendfile($path); +// +// while ($file = fread($open, $limit)) { +// $this->response->write($file); +// fseek($open, $offset); +// if ($sleep > 0) { +// sleep($sleep); +// } +// if ($offset >= $stat['size']) { +// break; +// } +// $offset += $limit; +// } +// +// $this->response->end(); $this->response = null; return '';