lib/FileWrapper.php
protected function sendContent(): bool
    {
        if (is_null($this->path)) {
            $this->sendInternalError();
            return false;
        }
        if (is_null($this->request)) {
            $this->sendInternalError();
            return false;
        }
        if (is_null($this->etag)) {
            $this->sendInternalError();
            return false;
        }
        if (is_null($this->mime)) {
            $this->sendInternalError();
            return false;
        }
        if (is_null($this->filesize)) {
            $this->sendInternalError();
            return false;
        }
        //make sure zlib output compression turned off
        ini_set("zlib.output_compression", "Off");
    
        if ($this->attachment) {
            header('Content-Description: File Transfer');
            header('Content-Disposition: attachment; filename="' . $this->request . '"');
        }
        if ($this->maxage == 0) {
            header('Cache-Control: must-revalidate');
        } else {
            header('Cache-Control: max-age=' . $this->maxage);
        }
        header('Last-Modified: ' . $this->lastmod);
        header('ETag: "' . $this->etag . '"');
        header('Accept-Ranges: ' . $this->ranges);
        if ($this->fullfile) {
            header('Content-Length: ' . $this->filesize);
        } else {
            header('HTTP/1.1 206 Partial Content');
            header('Content-Length: ' . $this->total);
            header('Content-Range: bytes ' . $this->start . '-' . $this->end . '/' . $this->filesize);
        }
        if (! is_null($this->allowOrigin)) {
            header('access-control-allow-origin: ' . $this->allowOrigin);
        }
        header('Content-Type: ' . $this->mime);
        header_remove('X-Powered-By');
        try {
            $this->readFromFilesystem();
        } catch (\Error $e) {
            error_log($e->getMessage());
            $this->sendInternalError();
            return false;
        }
        return true;
    }
protected function sendContent(): bool
    {
        if (is_null($this->path)) {
            $this->sendInternalError();
            return false;
        }
        if (is_null($this->request)) {
            $this->sendInternalError();
            return false;
        }
        if (is_null($this->etag)) {
            $this->sendInternalError();
            return false;
        }
        if (is_null($this->mime)) {
            $this->sendInternalError();
            return false;
        }
        if (is_null($this->filesize)) {
            $this->sendInternalError();
            return false;
        }
        //make sure zlib output compression turned off
        ini_set("zlib.output_compression", "Off");
    
        if ($this->attachment) {
            header('Content-Description: File Transfer');
            header('Content-Disposition: attachment; filename="' . $this->request . '"');
        }
        if ($this->maxage == 0) {
            header('Cache-Control: must-revalidate');
        } else {
            header('Cache-Control: max-age=' . $this->maxage);
        }
        header('Last-Modified: ' . $this->lastmod);
        header('ETag: "' . $this->etag . '"');
        header('Accept-Ranges: ' . $this->ranges);
        if ($this->fullfile) {
            header('Content-Length: ' . $this->filesize);
        } else {
            header('HTTP/1.1 206 Partial Content');
            header('Content-Length: ' . $this->total);
            header('Content-Range: bytes ' . $this->start . '-' . $this->end . '/' . $this->filesize);
        }
        if (! is_null($this->allowOrigin)) {
            header('access-control-allow-origin: ' . $this->allowOrigin);
        }
        header('Content-Type: ' . $this->mime);
        header_remove('X-Powered-By');
        try {
            $this->readFromFilesystem();
        } catch (\Error $e) {
            error_log($e->getMessage());
            $this->sendInternalError();
            return false;
        }
        return true;
    }
Send headers and then the file, for binary file.

@return bool True on success, False on failure.