I just set up Drupal for a client. Now that we're live they're noticing that downloads aren't very stable.

I haven't been able to reproduce the issue, but a couple different users tried to download ZIP files (through Drupal) and aren't able to open the compressed ZIP files because they appear to be corrupt or incomplete.

I've had my client use WinZip and 7-zip to create the compressed ZIP files and it's happening with both. I've been able to download the files and open them just fine... so I know it's not an issue with the file itself. My best guess is that this issue is happening with slower connections.

What can I change or check to make sure downloads through Drupal are a little more consistent and stable?

Thanks

Comments

yelvington’s picture

Are you configured for private or public downloads?

kizmar’s picture

Private... will I have to set this to public to address the issue?

this_is_it’s picture

my client also reports that the downloaded file size is not the same as declared, for example, one can only download around 3M while the actual file size is 13M。

so i'm thinking why one could not download the full size. there are some factors deserved to analyze:
1. network connection speed is too slow;
2. considerding performance drupal disconnects automatically while downloading takes too much time.

my client's network connection speed is 100-150k/s, and i set the max execution time 30s in php.ini, so my client could only download (100~150)*30 KB = around 3M.

so solution may be max execution time should be increased according to the connection speed and the restricted max file size allowed to be uploaded.

i have not try it, wish luck.

kizmar’s picture

So we're still having ZIP download issues with this client. I'm having them Zip files using 7zip, then upload to the page through Drupal.

Here's what I'm seeing:
- The file will randomly not show download progress within the browsers tools.
- When downloaded in IE the Zip file appears corrupt
- When downloaded in Chrome it seems fine

Is there a known issue with site downloads through IE 7 & 8?

I have already tried changing several settings based on this thread and others, but nothing has fixed the issue. I wasn't able to reproduce the error until I downloaded the file with IE.

See: http://drupal.org/node/213262

yelvington’s picture

Since you're using the private download method, Drupal and PHP are involved in your downloads and you may be running into timeout issues. I would suggest looking at your webserver's error logfile.

kizmar’s picture

The site is in Public download mode, still doesn't work.

I'll see if I can track down the web host errors. ;)

this_is_it’s picture

300s or much more.

kizmar’s picture

I figured out what the problem was. I still don't know why IE was the only browser that this affected, but none-the-less...

So we were uploading a file to attach to a page. The page content had a link that was pointing to the file for download. I noticed that if I changed the file path from "../system/files/ [...]" to "/site/default/files [...]" it fixed the problem. No more corrupt or partial downloads in IE.

There must be something about the way Drupal is pointing directories with the path method that's confusing IE.

mdlueck’s picture

to "/site/default/files [...]" it fixed the problem

To me it looks like you are operating in Public file download mode, not Private. Is this correct?

kizmar’s picture

Yes, but I was having this issue using both methods. Changing that didn't make a difference.

I also changed a few other download/PHP related settings that did nothing.

Not until I changed the path did the download issues stop.

mdlueck’s picture

Not until I changed the path did the download issues stop.

However the URL for Private mode attachments MUST be what Drupal lists in the file attachment area. So I guess this fix / workaround is for only public file attachments, correct?

betsonthomas’s picture

I ran into a similar issue (corrupted/incomplete files with private downloads, but worked fine when set to public downloads). Setting output_buffering = On as well as boosting the max_execution_time in php.ini seemed to help the problem. Make sure to check that your changes to php.ini are taking effect via phpinfo().

mdlueck’s picture

Are you saying that with the php adjustments it is fixed using the Private download method?

betsonthomas’s picture

Using the private file system, making those php adjustments helped the issue, but didn't completely solve it. A higher percentage of the downloads are completing successfully than not. However, the shared hosting provider just confirmed that their automatic process monitor is killing off excess php processes for our account. I'm assuming that the remaining failed downloads can be attributed to this. We're looking to host our most frequently downloaded files elsewhere to help mitigate this issue.

Responding to an earlier comment, I should mention that our issue was browser independent. I was able to reproduce the issue in all major browsers.

mdlueck’s picture

Thank you for confirming. I will look into making those adjustments.

For one client, we had to move their sites to a VPS solution as the hosting provider's "CPU Utilization Police" were killing our cron.php executions / would not let them complete. This is the client I am mostly concerned about file attachments for as their site has many attached files. D5 was fine on shared hosting, but the upgrade to D6 required the VPS. I have seen cron runs take up to two mins to complete. I think the provider said that shell scripts may run for like 15 seconds, but I had logs of them killing cron run scripts as soon as TWO seconds into execution. All that sort of nonsense goes away in the VPS environment! :-)

Feel free to direct contact me for assistance selecting a next provider. I will share stories from our "lessons learned" category.

jsolanaGBT’s picture

Hi, I have a similar problem, when some users try to download a file (1Gb) sometimes the process stops before it's completed.

I have changed my php.ini file with this variables but it doesn't work. Even more, it's getting worse!

session.gc_maxlifetime = 10800
output_buffering = On
max_execution_time = 10800

I have 1and1 hosting and Drupal 7...

Thanks

jsolanaGBT’s picture

My problem was a problem with my service provider (1and1). They have php restrictions that cannot be changes unless you have a dedicated server.