Search code examples
apachehttpnetwork-programmingtransfer

Apache - Large zip file transfer corruption


I have an Apache server running on Ubuntu hosting some files available for download. The files hosted is a mounted nas drive.

I am finding that when I try downloading, via the web server, large zip files (.zip, .7z) of 100MB+ the transferred file is corrupted. The method I am using to check the files is performing a MD5 calculation. I am also finding that the file size correlates with the chance of corruption; bigger file, high chance of corruption. The mount seems to be fine, because I transferred files from NAS to the machine without any issues.

I also have IIS running on windows hosting the same files. When I download the files via this web server there is never a corruption. This makes me think that the network itself is fine.

I am downloading the files via Chrome.

I'm not sure what is wrong but I am lead to believe it has to do with some configuration with Apache. How can I increase my file transfer reliability on Apache? Or is there another possible cause of issue?


Solution

  • It was an Apache configuration issue.

    Found the solution in this article

    Adding EnableSendfile On to the apache2.conf file fixed the corruption issue with large zip files. Apache 2.4 has this configuration default off while Apache 2.2 default its to on.