Changed files from UTF8 (with header) encoding to ANSI encoding. The UTF8 header is not understood by PHP and gets sent along with binary data in downloads and makes the downloaded file invalid because it has the 3 UTF8 header characters at the beginning.