Is it possible to stream partial content?

Hi. i use stream for users to download files.
I tried many ways to stream partial content, but none of them worked, I tested everything in google chrome, and despite the fact that the HTTP_RANGE header came to the server, the download stopped.

Code for get file size, offset etc.

$fileSize = filesize("../" . $path ."/".$file);
preg_match('/bytes=(\d+)-(\d+)?/', $_SERVER['HTTP_RANGE'], $matches);
$offset = intval($matches[1]);
// $fileLength = intval($matches[2]) - $offset;
$fileLength = $fileSize - $offset;
$end = $offset + $fileLength;
$fd = fopen("../" . $path ."/".$file, "r");

Ways i tried:

// DelayStream - my custom stream just have a delay for download
$stream = new DelayStream(Utils::streamFor($fd, ['size' => $fileLength]));
$stream->seek($offset);
return $response->withStatus(206)
->withBody($stream)
->withHeader('Content-Description', 'File Transfer')
->withHeader('Content-Type', 'application/octet-stream')
->withHeader('Content-Disposition', 'attachment; filename=' . $file_name)
->withHeader('Content-Transfer-Encoding', 'binary')
->withHeader('Accept-Ranges', 'bytes')
->withHeader('Content-Range', "bytes $offset-".($end-1)."/$fileSize")
->withHeader('Content-Length', $fileSize);

And:

fseek($fd, $offset);
$data = fread($fd, $fileLength);
$logs::logReWriteS("Your mother is: $data", "Lol.log");
$response->getBody()->write($data);
return $response->withStatus(206)
->withHeader('Content-Description', 'File Transfer')
->withHeader('Content-Type', 'application/octet-stream')
->withHeader('Content-Disposition', 'attachment; filename=' . $file_name)
->withHeader('Content-Transfer-Encoding', 'binary')
->withHeader('Accept-Ranges', 'bytes')
->withHeader('Content-Range', "bytes $offset-".($end-1)."/$fileSize")
->withHeader('Content-Length', $fileSize);

Without partial content it work awesome:

$stream = new DelayStream(Utils::streamFor($fd));
return $response->withBody($stream)
->withHeader('Content-Description', 'File Transfer')
->withHeader('Content-Type', 'application/octet-stream')
->withHeader('Content-Disposition', 'attachment; filename=' . $file_name)
->withHeader('Content-Transfer-Encoding', 'binary')
->withHeader('Content-Length', $fileSize);

I use slim 4 and GuzzleHttp for stream

Did you get anywhere with this?