As an alternative you may just return a readable PHP stream together with size and modification time information from the GET() method. By doing so you do not have to deal with HTTP header generation yourself and get support for partial GET requests without taking further action as an additional benefit.

<?php
  
function GET(&$param
  {
      
$fspath $this->base $param["path"];
      
      if (
file_exists($fspath)) {             
          
$param['mimetype'] = mime_content_type($fspath); 
          
$param['mtime']    = filemtime($fspath);
          
$param['size']     = filesize($fspath);
          
$param['stream']   = fopen($fspath"r");
          
          return 
true;
      } else {
          return 
false;
      }               
  }
?>
Note that no further error checking is needed on calling fopen() here. The base class will take appropriate action if the returned stream is not a PHP resource or not readable.