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->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 '';