src/FileStreamer.php
/**
     * Send multiple ranges of file content to the client.
     *
     * @return void
     */
Send multiple ranges of file content to the client.
@return void
Send multiple ranges of file content to the client . @return void
private function sendMultipleRanges(): void
    {
        $fileInfo = new finfo();
        $mimeType = @$fileInfo->file($this->fileInfo->getPathname(), FILEINFO_MIME_TYPE);
        $fileSize = $this->fileInfo->getSize();
        $this->setMultipartFormats();
        $this->sendHeaders(self::CONTENT_PARTIAL);
        foreach ($this->fileRanges as $range) {
            echo $this->multipartFormats['boundaryStart'];
            echo 'Content-Type: ' . ($mimeType ?: 'application/octet-stream') . "\r\n";
            echo sprintf($this->multipartFormats['rangeFormat'], $range['start'], $range['end'], $fileSize);
            $this->flush($range['start'], $range['end']);
        }
        echo $this->multipartFormats['boundaryEnd'];
    }
private function sendMultipleRanges ( ) : void { $ fileInfo = new finfo ( ) ; $ mimeType = @ $ fileInfo -> file ( $ this -> fileInfo -> getPathname ( ) , FILEINFO_MIME_TYPE ) ; $ fileSize = $ this -> fileInfo -> getSize ( ) ; $ this -> setMultipartFormats ( ) ; $ this -> sendHeaders ( self :: CONTENT_PARTIAL ) ; foreach ( $ this -> fileRanges as $ range ) { echo $ this -> multipartFormats [ 'boundaryStart' ] ; echo 'Content-Type: ' . ( $ mimeType ? : 'application/octet-stream' ) . " \r \n " ; echo sprintf ( $ this -> multipartFormats [ 'rangeFormat' ] , $ range [ 'start' ] , $ range [ 'end' ] , $ fileSize ) ; $ this -> flush ( $ range [ 'start' ] , $ range [ 'end' ] ) ; } echo $ this -> multipartFormats [ 'boundaryEnd' ] ; }
Send multiple ranges of file content to the client.
Send multiple ranges of file content to the client .