[ZendTo] Re: ob_flush Error

Jules Jules at Zend.To
Thu May 24 10:32:39 BST 2012


I've just done your first change for now. I can't output strings of 
spaces, as this is in the code that downloads the file you've asked for, 
in which you obviously don't want loads of extra " " characters!

We'll see how this goes.

Jules.

On 23/05/2012 13:50, Phil Daws wrote:
> The quick fix would be to change the code as-follows from:
>
>          //  Open the file:
>          $fptr = fopen($this->_claimDir."/".$fileList[0]['tmpname'],'rb');
>
> too:
>
>          //  Open the file:
>          ob_start();
>          $fptr = fopen($this->_claimDir."/".$fileList[0]['tmpname'],'rb');
>
> though from reading about flush on the PHP site a good suggestion is to create a new flush function eg:
>
> function flush (){
>      echo(str_repeat(' ',256));
>      // check that buffer is actually set before flushing
>      if (ob_get_length()){
>          @ob_flush();
>          @flush();
>          @ob_end_flush();
>      }
>      @ob_start();
> }
>
> and then just call flush() and be done with ob_flush().

Jules

-- 
Julian Field MEng CITP CEng
www.Zend.To

Follow me at twitter.com/JulesFM
PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654

'It's okay to live without all the answers' - Charlie Eppes, 2011
'All programs have a desire to be useful' - Tron, 1982
'That is the land of lost content,
  I see it shining plain,
  The happy highways where I went,
  And cannot come again.' - A.E. Houseman



More information about the ZendTo mailing list