Ensure file is written in binary mode.

I found this while running the DEA on Windows - the `app.zip` file can't be opened since it's corrupt.