
: The mimetype file has an extra field of length n. The use of the extra field feature of the ZIP format is not permitted for the mimetype file I am using the C# library DotNetZip (Ionic.Zip
I am using the C# library DotNetZip (Ionic.Zip and Ionic.Zlib) to generate an ebook from a directory. Directory looks like this:
BookName
|
|___content/
| images/
| css/
| (html pages, .ops, .ncx)
|
|___META-INF/
| container.xml
|
|___mimetype
The code to generate the archive looks like this:
using (ZipFile zip = new ZipFile(pathTemp + ".epub"))
{
zip.RemoveSelectedEntries("*.*");
zip.AddFile(mimetype, "").CompressionLevel = CompressionLevel.None;
zip.AddDirectory(pathTemp + "content", "content");
zip.AddDirectory(pathTemp + "META-INF", "META-INF");
zip.Save();
}
When I run it through the EPUB Validator, it throws this error:
The mimetype file has an extra field of length 36. The use of the extra field feature of the ZIP format is not permitted for the mimetype file.
I'm not compressing the mimetype file, so I don't know what is happening.
UPDATE: This problem has been solved; see the solution here.
Free books android app tbrJar TBR JAR Read Free books online gutenberg
More posts by @Radia

: Kindle Paperwhite Repair Code 2 One of my Kindle Paperwhite's recently came up with "Your Kindle needs repair" with a Repair Code 2. Amazon instantly sent out a new device, no questions asked
2 Comments
Sorted by latest first Latest Oldest Best
I'm responsible for an attempt to improve this error message, see github.com/IDPF/epubcheck/pull/497 for details. Essentially your Zip packer puts some application or operating system specific stuff into the file, which breaks EPUB mimetype magic number support.
Free books android app tbrJar TBR JAR Read Free books online gutenberg
Ive also had some problems with compression of the mimetype file. What I ended up doing was adding the entry myself from a byte[].
using (ZipOutputStream zs = new ZipOutputStream(pathTemp + ".epub"))
{
var o = zs.PutNextEntry("mimetype");
o.CompressionLevel = CompressionLevel.None;
byte[] mimetype = System.Text.Encoding.ASCII.GetBytes("application/epub+zip");
zs.Write(mimetype, 0, mimetype.Length);
}
using (ZipFile zip = new ZipFile(pathTemp + ".epub"))
{
zip.RemoveSelectedEntries("*.*");
zip.AddDirectory(pathTemp + "content", "content");
zip.AddDirectory(pathTemp + "META-INF", "META-INF");
zip.Save();
}
This should fix it for you.
Free books android app tbrJar TBR JAR Read Free books online gutenberg