title: Download file using fread in while loop - restrictions
body: <p>I'm downloading a large file like that:</p>
  
  <pre><code>$fd = fopen($url, "r");
  
  while(!feof($fd))
  {
      set_time_limit(0);
  
      echo fread($fd, 4096);
      ob_flush(); 
      flush();
  }
  </code></pre>
  
  <p>But in this script I have one problem - my web server has a three restrictions:</p>
  
  <ul>
  <li>max_execution_time - <strong>max</strong> 450 seconds,</li>
  <li>max_input_time - <strong>max</strong> 450 seconds,</li>
  <li>memory_limit - <strong>max</strong> 256M.</li>
  </ul>
  
  <p>Finally I can download only a part of a file...</p>
  
  <p>I'm downloading this file for watch a movie on my web site using flowplayer. 
  How I can change this script - it should "refresh"/reload every downloaded (for example) 2MB. Is it possible?</p>
  
  <p>Thanks.</p>