Skip to content
EPUBCheck · Package and ZIP container

EPUBCheck PKG-009: forbidden file name character

Updated:

EPUBCheck PKG-009 is an error message: “The file name "…" contains characters that are not allowed in OCF file names: ….” A file name inside the EPUB contains a character that the EPUB container rules do not allow in file names. The restriction exists so that the same names work on every operating system that unpacks the book.

The official message

The file name "%1$s" contains characters that are not allowed in OCF file names: %2$s.

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

  • Characters such as ", *, :, <, >, ?, \ or |, or control characters, usually copied from the original title of an image or chapter.
  • Files exported from a tool that names them after headings or captions.

How to fix it

  1. Rename the file using letters, digits, hyphens and underscores.
  2. After renaming, update every reference to the file: the manifest in the package document, links and image sources in the XHTML, and url() references in the CSS.
  3. Rebuild the archive and validate again; any reference you missed shows up as RSC-007.

When it's not this

Spaces are allowed and only give the PKG-010 warning; non-ASCII letters give PKG-012.

Terms used here

Other PKG messages

  • PKG-008 Unable to read file "…".
  • PKG-010 The file name "…" contains spaces, which may create interoperability issues with older reading systems.
  • PKG-007 The content of the mimetype file must be the string "application/epub+zip"…
  • PKG-011 The file name "…" is not allowed to end with ".".
  • PKG-006 Mimetype file entry is missing or is not the first file in the archive.
  • PKG-012 The file name "…" contains non-ASCII characters, which might create interoperability issues with older reading systems.

Sources

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

FAQ

What does EPUBCheck PKG-009 mean?

EPUBCheck PKG-009 is an error message: “The file name "…" contains characters that are not allowed in OCF file names: ….” A file name inside the EPUB contains a character that the EPUB container rules do not allow in file names. The restriction exists so that the same names work on every operating system that unpacks the book.

Is PKG-009 an error?

PKG-009 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.

PDF to EPUB tools

Every tool uses the same engine and starts with a free 5-page sample.