Invalid zip file for digital downloads
If a digital download produces a zip file that you or your customers cannot unzip or open, the file almost certainly arrived incomplete.
Why it happens
Your web server runs out of memory partway through building the zip and stops. The partial file still gets sent to the browser, so the download itself looks like it worked. It's only when someone tries to open it that the problem shows up.
Shared hosting is where this comes up most often, and available memory there can change through the day depending on how busy the other sites on your server are. That's why the same download can work one day and fail the next.
How to fix it
First, update the Digital Downloads add-on. Newer versions send the zip to the browser as it is built rather than assembling the whole file on your server first, so the size of an order no longer determines whether it works. If you have been living with this problem, updating is the thing most likely to end it.
Then increase your memory. Raising the memory available to WordPress gives the server the room it needs. This is still worth doing even after updating, because building large images and applying watermarks needs memory too.
Consider background processing. If your host is particularly limited, downloads can be prepared behind the scenes and emailed to your customer as a link instead of delivered on the spot. See Background Download Queue.
If the zip only fails on an iPhone or iPad
That's a different problem with the same symptom. Older versions didn't tell Safari how big the file was before sending it, so Safari would cut the download short and produce a zip that wouldn't open. Updating the Digital Downloads add-on fixes it.
Still not working?
Open a support ticket and I will look into your specific setup in more detail. It helps to know how many images were in the download, whether your photos are stored locally or in cloud storage, and what your memory limit is currently set to.
Still need help?
If you have not yet found your answer in the documentation articles, please contact support