Skip to content
EPUBCheck · Package and ZIP container

PKG-007

Updated:

EPUBCheck PKG-007 is an error message: “The content of the mimetype file must be the string "application/epub+zip"….” The mimetype file must contain exactly the text application/epub+zip, with nothing before or after it.

The official message

The content of the mimetype file must be the string "application/epub+zip"%1$s

Variants

  • whitespace: with no whitespace or newline.
Default severity
Error. The EPUB breaks a rule of the specification and is invalid. Stores and Send to Kindle may reject it, and EPUBCheck exits with status 1.
EPUBCheck version
5.4.0

%1$s, %2$s… are filled in with the file, value or element EPUBCheck found.

Typical causes

  • A trailing newline or space added by a text editor.
  • A different value, such as a typo or another media type.

How to fix it

  • Recreate the file without a newline, for example with printf 'application/epub+zip' > mimetype, then rebuild the archive with mimetype first: Rebuild the archive with the mimetype file first and stored uncompressed, for example from the folder that contains the book: zip -X0 book.epub mimetype and then zip -rX9 book.epub META-INF OEBPS (use your own folder names).

Terms used here

Other PKG messages

  • PKG-006 Mimetype file entry is missing or is not the first file in the archive.
  • PKG-005 The mimetype file has an extra field of length …. The use of the extra field feature of the ZIP format is not permitted for the mimetype file.
  • PKG-009 The file name "…" contains characters that are not allowed in OCF file names: ….
  • PKG-004 Corrupted EPUB ZIP header.
  • PKG-010 The file name "…" contains spaces, which may create interoperability issues with older reading systems.
  • PKG-003 Unable to read EPUB file header. This is likely a corrupted EPUB file.

Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EPUBLab.

FAQ

What does EPUBCheck PKG-007 mean?

EPUBCheck PKG-007 is an error message: “The content of the mimetype file must be the string "application/epub+zip"….” The mimetype file must contain exactly the text application/epub+zip, with nothing before or after it.

Is PKG-007 an error?

PKG-007 is reported as error by default. The EPUB breaks a rule of the specification and is invalid. Stores and Send to Kindle may reject it, and EPUBCheck exits with status 1.