Al Brookbanks Posted September 21, 2006 Share Posted September 21, 2006 Hi, Hopefully people will find this useful. If your digital download aborts before the file is complete it is because the memory allocated to the php script is all used up. A typical scenario is that the file is say 4.5MB but only 1.9MB is downloaded. To fix it open /download.php and find: readfile($download[0]['digitalDir']); Replace this with: function readfile_chunked ($filename) { $chunksize = 1*(1024*1024); // how many bytes per chunk $buffer = ''; $handle = fopen($filename, 'rb'); if ($handle === false) { return false; } while (!feof($handle)) { $buffer = fread($handle, $chunksize); print $buffer; } return fclose($handle); } readfile_chunked($download[0]['digitalDir']); I hope people find that useful. Quote Link to comment Share on other sites More sharing options...
Guest Posted September 21, 2006 Share Posted September 21, 2006 Thanks Al, added to the pinned post for future reference */* Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted September 22, 2006 Author Share Posted September 22, 2006 Thankyou kind sir!! (Not in the Elton kinda way) Quote Link to comment Share on other sites More sharing options...
Guest Posted September 24, 2006 Share Posted September 24, 2006 ROFL :whistle: Quote Link to comment Share on other sites More sharing options...
Guest faxinadu Posted January 5, 2007 Share Posted January 5, 2007 oh awsome! exactly the info i was looking for, many thanks :wub: Quote Link to comment Share on other sites More sharing options...
Guest faxinadu Posted January 5, 2007 Share Posted January 5, 2007 something is not right, i have this problem too, and i was going to do this suggested fix only to find it has already been done on my files, assuming this fix was included officially in a cubecart release after this post was written? anyhow, i still have this problem even with the above code in place. any thoughts? Quote Link to comment Share on other sites More sharing options...
Guest faxinadu Posted January 6, 2007 Share Posted January 6, 2007 i have the same problem this solution didn't help Quote Link to comment Share on other sites More sharing options...
Guest Posted January 6, 2007 Share Posted January 6, 2007 What would be really cool would be if CC could record incomplete download attempts and the percentage at which they failed. Is this even possible? Quote Link to comment Share on other sites More sharing options...
Guest faireymel Posted June 13, 2008 Share Posted June 13, 2008 I just started using digital and have this error and this fix is already included in my files. What happens now? CCV3.0.17 Thanks for anyone who helps. Quote Link to comment Share on other sites More sharing options...
Guest groovejuice Posted June 15, 2008 Share Posted June 15, 2008 Usually this problem is from having an incorrect path in your digital product set-up, filenames that don't match (paths are case sensitive), or too many characters in the folder/filename, or symbols that aren't alpha-numeric. 1. Ensure the path is correct. Use your root directory if possible (same level as html or web directory -not in it) 2. Be consistent when naming folders and files - I use lower case when possible. Avoid spaces in names and keep the filenames short. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.