Learn how to repair a corrupt file using ZIP recovery programs.

Corrupt ebook files

If your software shuts down suddenly while saving a file, the file will automatically become corrupt and refuse to open later on. Keeping dated backups for every step you take (using the File > Create timestamped backup option) is strongly recommended to ensure your project file is safe. However, if you haven't made any backups, we can help you recover your content using the following steps.

A KPUB2 file is basically a ZIP archive. The first step to take is to verify that the file is actually corrupt. Rename the KPUB2 extension to ZIP and open the archive using any zip file extractor of your choice (e.g. Winzip, Winrar, or your operating system's basic file explore). It should alert you that the archive is corrupt.

Zip recovery programs

Although the file is corrupted, it does not necessarily mean that it is missing data. All the data is most likely there, but only a few bytes will have been written incorrectly and could be causing this corruption. What you need to do is rely on professional ZIP recovery programs that recover as much data as possible from the archive. Every ZIP recovery program behaves differently (with varying tolerance to corrupt bytes) possibly giving you a different set of files.

We are particularly impressed with PowerArchiver 2016, which recovered several corrupt project files for us in the past. It is not free but gives you a 10-day free trial.

Here are the steps to follow:

  1. Go to Tools > Repair Zip Archive.
  2. Select the ZIP file (which was originally the KPUB2 extension).
    A fixed archive will be created in the same root as your broken archive (the filename ending with _PAfixed.zip). 
  3. Extract the files using your standard zip extractor program to check the files inside before renaming the extension to KPUB2. Sometimes a file or two would be missing.
    If these are standard files, you can simply copy and paste them from another project (e.g. container.xml file). Some files are tightly related to the project (e.g. package.opf) but they can be constructed manually using any text editor.
  4.  Select all the files inside the extracted folder after everything has been checked, and compress it back into a ZIP archive
  5. Rename the extension from ZIP to KPUB2, and open it with Kotobee Author.

There are other free alternatives to PowerArchiver 2016 mentioned here: 6 Ways to Repair and Extract Invalid ZIP Files for Free.