I've got a very busy Drupal Commerce website that sells designs but almost on a weekly basis someone complains that they downloaded their purchased design and it was corrupt. I'm sure the corrupt parts comes in when it doesn't download completely. I have experienced this myself but it was when the website was very slow due to hosting service.

But it's an ongoing issue and I don't know if it's something wrong on my side or a bug in Commerce File or slow internet that is causing this...

please help

Comments

hmartens’s picture

A customer again had this problem today...they're using Internet Explorer 8. She says she switched over to Chrome and the file downloaded completely and working.

IE8 problem or is it because Chrome has a better download manager?

hmartens’s picture

Status: Active » Closed (fixed)

This is not a Commerce File issue but rather the way the webserver was
set up. It happens when HTTP compression is enabled on Apache (or IIS)
and Internet Explorer 6, 7 and 8 does not handle HTTP compression well
and your Apache server is set to compress zip files which are already
compressed.

So the two ways to get the downloads to work is to either go in to your
IE Tools>Internet Options>Advance tab and uncheck "HTTP1.1" and to clear
browser cache. But this is not suitable for a Commerce website because
you can't expect your clients to go through all of this to download
something they bought, so here follows the solution that worked for me:

In .htaccess I added this line right at the bottom:
RewriteRule ^(.*)$ $1 [NS,E=no-gzip:1,E=dont-vary:1]
Then I cleared all cache on Drupal and voila it worked! It must be noted
that this does disable all compression on your website...but it works
which is important :)

no7rosman’s picture

I have this same problem and tried quite a few different solutions online with no success.

This to clean up the BOM
find . -type f -exec sed '1s/^\xEF\xBB\xBF//' -i.bak {} \; -exec rm {}.bak \;

I tried the solution from this thread and nothing helps.

Please let me know if you have any other ideas. It happens on all browsers.