citizen_insane Posted July 14, 2011 Share Posted July 14, 2011 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; Link to comment https://forums.phpfreaks.com/topic/242003-incomplete-downloads-with-wordpress-script/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.