Large (150mb) downlaods from my website are failing...why?

Joined
May 2, 2006
Messages
565
I'm currently working on setting up a webpage for a new start up music label and we're having issues with files not downloading completely. The site is running the latest version of Wordpress and we're using the plugin WP Download Codes to allow customers to download albums from the website directly.

The site is hosted on godaddy.

About 40% of our testers have reported incomplete downloads which corrupt the zip files. They also claim they have never had issues with large files before. FTP works every time, the testers who had issues could download the files via FTP which means the problem is with http downloads only.

Godaddy claims that their servers will never disconnect an ongoing download.

What gives?

(I realize that wireless could be a factor in this, but then why don't they have issues with other large files hosted on other servers like CNET or other download repositories?)
 
Last edited:
You are severely limited in your ability to figure out what is causing the issue and do anything about it as a result of selecting a shared hosting service for this project. I don't really have any suggestions other than to migrate to a VPS or dedicated, ASAP. This will give you full control over the server so you can set up the environment yourself to handle large file transfers and such.

I'm not sure how that WP plugin works because I have never used it, but if it is passing the download through a PHP script somehow, you could be hitting a max memory or filesize limit in PHP. If this is the case, you probably can't do anything about it since GoDaddy probably won't let you modify those limits in your php.ini, if they support php.ini modifications at all. Large files should never be passed through a PHP interpreter, precisely for this reason.

On your VPS or dedicated server, I'd recommend using Lighty's mod_SecDownload to handle your download tokens directly in the server instead of through PHP. Check it out here:
http://redmine.lighttpd.net/wiki/lighttpd/Docs:ModSecDownload
 
Thanks for chiming in CEpeep, I appreciate the help.

Won't moving to a VPS or dedicated server be really expensive? We're not a big label, we're very small and very specific. Right now we're paying $7 a month for hosing. If we can get a VPS/deticated server for $10, I might be able to convince people to move, otherwise it's just not possible, we couldn't afford it.

Is there an easy way to tell if the download is being passed through a script? What should I look for in the code? I do have access to the php.ini file for the server so I could change the max file size limits.
 
Changing hosts is an option.

I'd be more interested in finding out what the difference(s) are between your environment (and the testers' environment) versus the users complaining of dropped/corrupted downloads. For the HTTP downloads: Is it all downloads that likely error-out, or just those above a certain file size?
 
Changing hosts is an option.

I'd be more interested in finding out what the difference(s) are between your environment (and the testers' environment) versus the users complaining of dropped/corrupted downloads. For the HTTP downloads: Is it all downloads that likely error-out, or just those above a certain file size?

I would really like to know that too. Both me and my friend (both very tech savvy when it comes to things beyond configuring a web server :)) had no issues. Most of the people reporting problems were on Mac's running Safari but my roommate's Macbook running Safari has no issues. My friend who tested for me tried it on FF4 winXP and FF4 Linux and had no issues either.

The thing is that we need the downloads to be reliable for people that don't know how to set up their home network correctly, since that would be the majority of people out there.

I'm running another test, I posted a large zip file and directly linked to it, hopefully that will tell me if the Download Code script is messing things up or if it is indeed a server issue.
 
I would really like to know that too. Both me and my friend (both very tech savvy when it comes to things beyond configuring a web server :)) had no issues. Most of the people reporting problems were on Mac's running Safari but my roommate's Macbook running Safari has no issues. My friend who tested for me tried it on FF4 winXP and FF4 Linux and had no issues either.

The thing is that we need the downloads to be reliable for people that don't know how to set up their home network correctly, since that would be the majority of people out there.
It sounds like you've already got tests for the various OSs and browsers, which is why I'm wondering less about the computer people use and more of where they are actually located -- specifically at work (ie: corporate network) or at home.
 
It sounds like you've already got tests for the various OSs and browsers, which is why I'm wondering less about the computer people use and more of where they are actually located -- specifically at work (ie: corporate network) or at home.

I had no issues on my own personal Mediacom network, my friend who had no issues tested it on both his home network and his work network (BBC America). I'm guessing the other testers with issues were downloading from home. Most of them live in my area and some probably even have the same internet provider, although I'm not sure.
 
Last edited:
Thanks sheesh, I really should have checked the changelog.

I've started a thread over on the WP forums asking for help with the file streaming issue. I wish I knew more php, I would just make the downloads less secure so they just hard-linked to a static address. It would mean people could share the link, but it would also mean that the download wouldn't be messed up by the plugin.
 
I have changed the method of file streaming used by the plugin to something that's supposed to be more reliable. Here is the code, anyone see any 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;
 
Back
Top