I've inspected both documents (one downloaded from ftp and one downloaded through the browser) and the only difference between them is that the uncorrupted one has two additiona null bytes at the end of file while the corrupted one has those two additional bytes at the beggining but not at the end. I'll examine the behaviour while using alernative generate and download method you mentioned but it seems odd to me, especially that it used to work flawlessly before.