# PKG-007: wrong mimetype file content, how to fix it

Source: https://epubcc.com/epubcheck/pkg-007/ (updated 2026-11-04)

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. EPUB 3.3 forbids leading or trailing whitespace and a byte order mark in that file.

- Official message (EPUBCheck 5.4.0): The content of the mimetype file must be the string "application/epub+zip"%1$s
- Default severity: Error

## Typical causes

- A trailing newline or space added by a text editor.
- A different value, such as a typo or another media type.
- A byte order mark (BOM) added by an editor that saves UTF-8 with BOM.

## How to fix it

1. Recreate the file without a newline, for example with printf 'application/epub+zip' > mimetype.
2. 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).
3. Validate again.

## When it's not this

If the file is missing or not first in the archive, that is PKG-006.

## Sources

- EPUB 3.3, §4.3.3 OCF ZIP container media type identification: https://www.w3.org/TR/epub-33/#sec-zip-container-mime (read 2026-11-04)

Message text and severity: EPUBCheck (W3C, BSD-3-Clause). Explanation: EpubCC.
