I've been using a modified version of the Wodpress Download Codes plugin for a record label website that I've created that allows people to download digital albums. The zip files are about 130mb +-20mb. The issue we're having is with some users reporting issues of incomplete downloads. The download will finish (doesn't stop in the middle) but it will be a different size than the file hosted on the server. This leads me to believe that the file is only partially downloading thus corrupting the zip file.

The issue has been reported on all operating systems and browsers, but I have never witnessed it myself, just gotten the feedback from users/testers. Here is the code used to stream the file, can anyone see a reason why I would be having issues?

// Stream file
        $handle = fopen( dc_file_location() . $release->filename, 'rb' );
        $chunksize = 1*(1024*1024);
        $buffer = '';
        $cnt =0;
                if ($handle === false) {
                        return false;
                }
                while (!feof($handle)) {
                        $buffer = fread($handle, $chunksize);
                        echo $buffer;
                        ob_flush();
                        flush();
                        if ($retbytes) {
                                $cnt += strlen($buffer);
                        }
                }
                $status = fclose($handle);
                if ($retbytes && $status) {
                        return $cnt; // return num. bytes delivered like readfile() does.
                }
                return $status;
    Write a Reply...