This commit is contained in:
2021-03-09 19:16:04 +08:00
parent 00386c5335
commit 8484cddba0
+15 -13
View File
@@ -304,19 +304,21 @@ class Response extends HttpService
// $this->response->setHeader('Content-Disposition', ' attachment; filename="' . end($name) . '"'); // $this->response->setHeader('Content-Disposition', ' attachment; filename="' . end($name) . '"');
// $this->response->gzip(5); // $this->response->gzip(5);
while ($file = fread($open, $limit)) { $this->response->sendfile($path);
$this->response->write($file); //
fseek($open, $offset); // while ($file = fread($open, $limit)) {
if ($sleep > 0) { // $this->response->write($file);
sleep($sleep); // fseek($open, $offset);
} // if ($sleep > 0) {
if ($offset >= $stat['size']) { // sleep($sleep);
break; // }
} // if ($offset >= $stat['size']) {
$offset += $limit; // break;
} // }
// $offset += $limit;
$this->response->end(); // }
//
// $this->response->end();
$this->response = null; $this->response = null;
return ''; return '';