If I make the url for a zip file the href of a link and click the link, my zip file gets downloaded and opening it gets the contents as I expect.
href
Here\'
In my case, I was trying to create the file in a directory above public_html and the rules of the hosting didn't allow it.