EPUB FixerKDP upload error scanner

Mimetype compressed EPUB and invalid mimetype contents

Use this when the EPUB mimetype file contents are wrong or the file is compressed. Check the ZIP wrapper before you touch chapters, OPF, or navigation files.

The scan shows affected paths and repair decisions. It does not show manuscript text.

Not sure this kind of EPUB should be scanned here? Check unsupported or manual-only EPUB cases.

Scan report titles

  • PKG_007 mimetype file contents are invalid
  • mimetype file is compressed or has invalid contents
  • mimetype entry does not contain application/epub+zip exactly

Read the scan report

How to decide whether this report item matches Mimetype compressed EPUB and invalid mimetype contents.

Use the report label, affected file, and repair decision together. A matching title alone is not enough if the file path or EPUB structure points to a different problem.

Match the report title.

Look for "PKG_007 mimetype file contents are invalid" or the closest title listed above. If the platform wording is different, keep the original EPUBCheck, KDP, or Kindle Previewer message before choosing a fix.

Check the affected file first.

Use the report's Affected area, Source file, Target file, or Problem type rows before editing content.opf, nav.xhtml, toc.ncx, XHTML, CSS, or image paths.

Follow the repair decision.

Repairable means EPUB Fixer found one clear structural change. Manual review or Not supported means use the source project, formatter, or platform workflow instead of guessing.

Handoff summary

What to send to a formatter if this is not safely repairable.

Copy the report summary instead of rewriting the EPUB from memory. A useful handoff includes the source file, target file or field, original error, repair decision, and next step.

Source file
Target path or field
Original error
Repair decision
Next step

1. Example report output

What the PKG_007 report should show.

The report should focus on the archive wrapper, not on XHTML or OPF content.

EPUBCheck message

ERROR(PKG-007): mimetype file has invalid contents or is compressed.

Root entry

mimetype exists at archive root but contains application/epub+zip plus a trailing newline.

Storage

ZIP method is deflated instead of stored.

Do this next

Rebuild the archive only if the rest of META-INF and the OPF package are intact.

Do not do this

Do not patch random text files or rename a ZIP without checking the root entry order and storage method.

A safe repair means rebuilding the ZIP container so the mimetype entry is exact and stored correctly, then validating again.

2. Next step

Choose ZIP rebuild or package review.

PKG_007 is usually safe when the EPUB structure is otherwise intact, but it can hide a broader packaging mistake when the archive was built incorrectly.

Scan first

You only know the mimetype check failed.

Use the scan to see whether the mimetype text, storage method, and root package layout are all valid.

Matched

Safe repair

Only the mimetype wrapper is wrong.

Rebuild the ZIP with a correct root-level mimetype file stored uncompressed, then validate again.

Manual review

The whole archive layout may be wrong.

Stop when files sit under an extra parent folder, META-INF is missing, or the OPF path is also broken.

3. Concrete path example

A typical PKG_007 wrapper problem.

The issue is often one wrong byte or one wrong ZIP method on the root entry.

EPUBCheck:
ERROR(PKG-007): mimetype file has invalid contents or is compressed.

Report:
Root file: mimetype
Contents: "application/epub+zip\n"
Storage: deflated
Fix decision: safe repair if the rest of the package layout is valid

The mimetype entry should contain application/epub+zip exactly and be stored without compression.

Quick decision

Decide whether PKG_007 is only a wrapper rebuild.

This is often a packaging repair, not a content repair, as long as the rest of the EPUB layout is still coherent.

Scan first

You need to separate wrapper errors from deeper package damage.

Check the mimetype text, ZIP storage method, META-INF, and OPF path together before rebuilding.

Matched

Safe fix

The EPUB layout is otherwise intact.

Rebuild the ZIP container with the correct mimetype entry and then validate again.

Stop

The archive has broader packaging problems.

Do not treat PKG_007 as isolated when the root folder level, META-INF, or OPF path is also wrong.

Start here

Check the root mimetype file before editing the book content.

PKG_007 is a ZIP wrapper problem. The chapters can be fine while the root-level mimetype file is compressed or contains the wrong text.

Matched

What it means

The EPUB wrapper is not packaged like a valid EPUB. The root mimetype entry is wrong even if the book files themselves still exist.

Matched

Can it be fixed automatically?

EPUB Fixer can help when the package layout is otherwise intact and the only safe repair is to rebuild the ZIP wrapper with the correct mimetype entry.

Matched

What to check next

Open the EPUB as a ZIP package and locate the root-level mimetype entry.

Matched

What not to assume

It should stop when the EPUB also has missing META-INF files, a broken OPF rootfile path, nested parent folders, or broader archive damage that needs full package review.

Common situations

Common PKG_007 cases.

Start with the exact root mimetype entry the archive exposes.

Matched

The mimetype file contains extra whitespace or a newline.

The file exists, but its text is not exactly application/epub+zip.

Rewrite the mimetype file exactly, then rebuild the archive correctly.

The mimetype entry is compressed.

A generic archive tool stored the file with compression instead of the required stored method.

Rebuild the ZIP with mimetype uncompressed and first.

The mimetype file is valid but the whole archive root is wrong.

Files may sit under an extra parent folder or the root package layout may still be broken.

Review the full package layout instead of treating this as a single-file repair.

Several manual rezip attempts changed the wrapper.

Repeated archive edits can fix one packaging rule while breaking another.

Rebuild from a clean EPUB folder structure instead of stacking ZIP edits.

The PKG_007 mimetype content error text

PKG_007: The mimetype file contents are invalid or the file is compressed.

Where PKG_007 usually appears

EPUBCheck, Kindle Previewer, or KDP checks the ZIP wrapper and finds that the root-level mimetype file does not contain application/epub+zip exactly or is not stored the required way.

What it means

PKG_007 means the root mimetype entry is not stored the EPUB way.

The EPUB wrapper is not packaged like a valid EPUB. The root mimetype entry is wrong even if the book files themselves still exist.

Common causes include generic ZIP tools, trailing newlines, extra whitespace, wrong text encoding, compressed root entries, and repeated manual rezip attempts.

Before you edit

Inspect the root mimetype file and ZIP storage method.

Do not rename a generic ZIP to .epub and assume it is valid. The mimetype entry has to exist at the root, contain the exact text, and be stored without compression.

  1. 1Open the EPUB as a ZIP package and locate the root-level mimetype entry.
  2. 2Confirm the file contains application/epub+zip exactly, with no newline or extra whitespace.
  3. 3Check whether the ZIP storage method for mimetype is stored, not compressed.
  4. 4Review META-INF/container.xml and the OPF rootfile path before assuming this is an isolated wrapper error.
  5. 5Stop when the EPUB also shows broader archive layout problems.

Why KDP checks it

Why EPUB validators check the mimetype entry strictly.

EPUB ZIP container

The EPUB ZIP wrapper must point readers to the OPF file through META-INF/container.xml and keep packaged resources at the paths the book references.

EPUBCheck

EPUBCheck checks EPUB 2 and EPUB 3 files against the official rules and reports package, markup, link, and file-reference problems.

Can this be fixed safely?

When PKG_007 is safe to repair.

When automatic repair is safe

EPUB Fixer can help when the package layout is otherwise intact and the only safe repair is to rebuild the ZIP wrapper with the correct mimetype entry.

When you need manual review

It should stop when the EPUB also has missing META-INF files, a broken OPF rootfile path, nested parent folders, or broader archive damage that needs full package review.

Before / after example

Before: the archive root mimetype file is compressed or contains extra bytes. After: the archive starts with a correct root-level mimetype entry stored without compression, then validation runs again.

Ready to retry?

Scan the ZIP wrapper before rebuilding the archive.

A scan should show whether the root-level mimetype file exists, what text it contains, and whether the archive stored it without compression.

Upload EPUB to scan

FAQ

Questions authors ask about PKG_007.

What does PKG_007 mean?

It means the root-level mimetype entry is wrong. The file contents are not exactly application/epub+zip, or the entry was stored with the wrong ZIP method.

Can EPUB Fixer repair PKG_007 automatically?

Usually, yes, when the rest of the package layout is still valid and the safe repair is just a correct ZIP rebuild.

Is PKG_007 different from PKG_006?

Yes. PKG_006 is usually about the mimetype entry being missing or not first. PKG_007 is about the entry contents or compression method being wrong.

Should I edit chapters or content.opf for PKG_007?

No. Start with the archive wrapper because PKG_007 is a ZIP packaging problem, not a chapter or metadata problem.

Related EPUB error guides