Corrupted ZIP files during download via PHP

From: Swede (Swede_at_nospam.se)
Date: 02/15/05


Date: Tue, 15 Feb 2005 21:16:18 +0100

Hello,

I am posting this rather lengthy description here in hope of getting at
least some insight into a problem that is really hurting my business,
since I have come to the conclusion that my problem is at least partly
PHP-related.

Some time now I have been having transfer problems, i.e. my customers
downloads of large binary (ZIP) files are often corrupt.

A corrupted file now and then can of course never be avoided, but I get
several complaints from customers every day. Of any specific file,
approx. 1 out of 4 downloads (larger than 100kB or so) are affected.
I have spent months trying to find the source of the problems without
success, but I have been able to rule out many possible causes. Here are
some facts:

1) The actual files are OK on the server. Direct (unencrypted) links are
fine, so it's not a general problem.

2) About 50% of the customers download (the exact same files) from
another source. I don't even get 1 complaint every two months from those
customers, while I get 1-3 complaints _every day_ from those who
download from my server.

3) The customers have various SW/HW/OS, so it's very unlikely that it's
a user problem. Plus, the same customer often download from both places,
but only have problems with the files from my server.

4) I have shut down all scripts for a while, so that only a static
website remained, but it didn't help.

5) I have had this problem on three servers: The present RaQ550, the
previous RaQ4 and the RaQ4 I had before that. So it's highly unlikely
that it is server-related.

6) I can easily reproduce the problem myself. As I looked into this I
found a systematic error:

Analyzing corrupt vs. clean ZIP file downloads with a binary/hex editor
clearly shows that the error is systematic. Clean ZIP files have a lot
of '00h' bytes in them. In ALL of the corrupt ZIP files ALL (well, most)
of these bytes have been exchanged for '5C30h', i.e. TWO bytes ( 00h ->
5C30h ) !

Since '5C30h' equals an escaped zero, i.e. "\0", my guess is that there
is a translation error somewhere.

So, what does PHP have to do with this? Well, my download links to
purchaseware are encrypted by the PHP "ewportal":
http://www.eliteweaver.co.uk/antifraud/script.php?page=Home

 From the few facts I have been able to uncover it seems there is
sometimes a problem with corrupted ZIP files depending on the
setting/compilation of ZLIB. If anyone on this forum have experienced
similar things I would very much appreciate if they could share.
My servers PHP configuration is at:
http://www.snith.com/phptest.php

Best regards, Lars



Relevant Pages

  • Re: pps 97 download snag
    ... I think the file is probably corrupt, ... server and it works fine. ... >>> trying to download two different PSS files from the below website. ... >>> get the above error message. ...
    (microsoft.public.powerpoint)
  • Re: Cannot Receive Mail with LONG Message-ID
    ... Send Messages (Simple or Full MAPI) or access received messages. ... > Options were set to leave message on the server, but to remove after 14> days. ... Their conclusion was that the email was> being 'corrupted' somewhere along the line and that since OE is not "full> MAPI" that ... >> Or the issue might be that you have a message rule or Block Sender match> that caused the>> message to be deleted on a previous download. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: Apparent MTU Problem
    ... > Ipswitch IMail Server 8.15 on. ... > located in my office and customers had to go out over the public internet ... it will never download past that point. ... > alot of duplicate ACKs coming from the client side. ...
    (microsoft.public.windows.server.networking)
  • Re: Corrupted uploads
    ... You probably meant the DOWNLOAD is corrupt by the time it reaches the ... UPLOAD implies the user sending something to the server. ... Dr. Dennis W. Neder ...
    (microsoft.public.inetserver.iis)
  • Re: Downloading
    ... > how do I fix it. ... It means that you got a "bad" download. ... If the file is corrupt on the server you're downloading from, ...
    (microsoft.public.windowsxp.newusers)