I have my own script that get the content of a file and streams it and it also supports ranges requests providing resuming possibility for the downloads.

this is how the file is opened and with fseek it can support resume:

PHP Code:
              $fp=fopen($filepath,"rb");
              
fseek($fp,$first); 
              while(!
feof($fp)){
              
set_time_limit(0);
              print(
fread($fp,1024*8)); 
              
flush(); 
              
ob_flush();
              }
              
fclose($fp); 
Now what I want is to use this script to first put the content of the file into a zip file and then stream that zip file. (the only script that I found which supports writing zip files)


here where I have no idea what to do,

the content returned is the zip file content in a variable, but how can stream that, or more specifically, I want to be able use fseek to provide Resume support.