Digital download failed or zip file cannot be opened
If a gallery or order download fails, or produces a zip file that won't open, start here.
Start by making sure the Digital Downloads add-on is up to date. Newer versions send the zip to the browser as it is built instead of assembling the whole thing on your server first, which removes the most common cause of this by a wide margin. If you are on an older version, updating is the single most useful thing you can do. Updating also fixes zip files that wouldn't open on an iPhone or iPad.
Server memory
Your server can still run out of memory while preparing a download, and this remains the most common cause after an out of date add-on.
What happens is that the server gives up partway through building the zip, but the incomplete file is still sent to the browser. Your customer ends up with a zip that downloads normally and then refuses to open. There is more on that particular symptom in invalid zip file for digital downloads.
The fix is to increase the memory available to WordPress. Shared hosting is the usual culprit, and available memory there can vary through the day depending on how busy the other sites on your server are, which is why the same download can work one minute and fail the next.
Other causes
If memory isn't the problem, the trouble is usually with one specific file rather than with your server:
- A missing or unreadable source file. If an image was deleted or moved outside of WordPress, or its permissions changed, the download can't include it.
- A cloud storage connection problem. If your photos live in cloud storage, check your credentials are still valid and the bucket is reachable. See Cloud Storage.
- A dropped connection. A very large download over a slow or unstable connection can be interrupted. The customer can simply start it again.
Turning on Enable logging (Sunshine > Settings > General) records which file it was working on when the download stopped, which usually points straight at the cause.
Background download processing
Downloads can also be processed in the background rather than sent immediately. The customer gets a confirmation right away, then an email with a secure link once the zip is ready.
Most sites no longer need this. It's worth turning on if your host is particularly limited, or if you'd rather your customers receive a link by email than wait on the page. For setup steps see Background Download Queue, and if queued downloads seem slow to process, a reliable server cron helps them run on time.
Still stuck?
If none of the above helps, open a support ticket with your log output and I'll take a look at your specific setup.
Still need help?
If you have not yet found your answer in the documentation articles, please contact support