php: readfile_chunked not flushing last 2830 bytes of 29353KB file
<p>I am using a variation of the familiar readfile_chunked in attempt of download for larger files:</p>

<pre><code>    function readfile_chunked($filename)
    {
            $chunk_size = 1*(1024*1024); // how many bytes per chunk
            $buffer = '';
            $handle = fopen($filename, 'rb');
            if ($handle === false)
            {
                    return false;
            }

            while (!feof($handle))
            {
                    $buffer = fread($handle, $chunk_size);
                    print $buffer;
                    ob_flush();
                    flush();
                    sleep(1);
            }
            $status = fclose($handle);
            return $status;
    }
</code></pre>

<p>smaller files work fine, but this larger file is missing the last 2830 bytes.</p>
