![]() |
#1 | |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 126
Karma: 2167
Join Date: Oct 2005
Location: Houston, Texas
Device: ipad 1, Nook Simple Touch, Kindle 3, ebookwise 1150
|
epubcheck error: mimetype entry missing or not the first in archive
I am rolling my own epub files, and I'm getting an error on epubcheck.
Quote:
my .epub file has this structure Code:
myfile.epub OEBPS/ images index.html content.opf chapter1.html etc.... META-INF/ container.xml mimetype (this is a file and exists at root of the epub directory.) "application/epub+zip." I am generating most of my files from docbook, but i just used the same mimetype file from other valid epub file, with identical results. As I said, everything else is right. Is there something special I need to do about the way I zip up these directories, or is conceivably a whitespace issue? How fussy is the validator about the substance of the mimetype file? Thanks for your help. rj |
|
![]() |
![]() |
![]() |
#2 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
As the error says, the mimetype file has to be the first file in the zip, and must be stored without compression.
What I do (on linux) is create the zip/epub file in two steps. First create the zip only with mimetype, without compression: Code:
zip -0 file.epub mimetype Code:
zip -9 -r file.epub META-INF OEBPS |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 126
Karma: 2167
Join Date: Oct 2005
Location: Houston, Texas
Device: ipad 1, Nook Simple Touch, Kindle 3, ebookwise 1150
|
sorry to be such a windows wimp, but is there a windows way to do this?
I'm using a gui tool. hopefully i won't need to install cygwin? On linux, it looks so easy (sigh). Using izarcc, I was able to eliminate the previous error only to see that I've created another error which prevents epubcheck from working. epubcheck says; ERROR: first.epub: META-INF/container.xml is missing calibre ebook viewer says: --------------------------- ERROR: Could not open ebook --------------------------- File name in directory "META-INF\container.xml" and header "META-INF/container.xml" differ. this sounds like a zipping problem. There looks like there's an izarcc command line utility. Other ideas? Last edited by rjnagle; 10-10-2009 at 10:30 AM. |
![]() |
![]() |
![]() |
#4 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
I don't have Windows to try, but I'd say you can do something similar with Winzip:
1- Create a .zip file only with mimetype, and set it to no compression. 2- Add the rest of the files with maximum (or whatever) compression. |
![]() |
![]() |
![]() |
#5 | ||
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 126
Karma: 2167
Join Date: Oct 2005
Location: Houston, Texas
Device: ipad 1, Nook Simple Touch, Kindle 3, ebookwise 1150
|
yes, I tried doing what you suggested with izarc. same original problem.
Ok, I downloaded cygwin, check. I ran the exact commands mentioned above. Epubcheck gives me this message message and no other errors: Quote:
Quote:
I gotta say, this seems really weird. Last edited by rjnagle; 10-10-2009 at 01:30 PM. |
||
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 126
Karma: 2167
Join Date: Oct 2005
Location: Houston, Texas
Device: ipad 1, Nook Simple Touch, Kindle 3, ebookwise 1150
|
I'm not sure what I did, but when I ran this command in Cygwin shell instead, epubcheck said it worked.
$ zip -q0X rjpub.epub mimetype $ zip -r9 rjpub.epub OEBPS META-INF everything worked (for the time being at least). Not sure why. Please note that I never modified the mimetype file at any point. |
![]() |
![]() |
![]() |
#7 | |
speaking for myself
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 139
Karma: 2166
Join Date: Feb 2008
Location: San Francisco Bay Area
Device: PRS-505
|
Quote:
Also, you can do this on Windows by creating a new "compressed folder" and drag-n-dropping your mimetype file there before everything else. It is smart enough to figure such short file does not need compression. |
|
![]() |
![]() |
![]() |
#8 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Well, the actual commands I use are:
Code:
zip -X0 file.epub mimetype zip -X9Dr file.epub META-INF OEBPS Other than that, and ignoring that you said you did not modify the mimetype file, I'd think, as Peter says, there's something like a spurious end-of-line or space character. |
![]() |
![]() |
![]() |
#9 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,707
Karma: 32763414
Join Date: Dec 2008
Location: Krewerd
Device: Pocketbook Inkpad 4 Color; Samsung Galaxy Tab S6
|
I use zip.exe too, with this command:
zip.exe -Xr9D book.epub mimetype * And it works... (and I use Windows, not Linux or any other fancy OS that is so in vogue atm) |
![]() |
![]() |
![]() |
#10 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 126
Karma: 2167
Join Date: Oct 2005
Location: Houston, Texas
Device: ipad 1, Nook Simple Touch, Kindle 3, ebookwise 1150
|
thanks. fyi, the problem wasn't with the mimetype file (although I definitely have been bit by EOL characters before), but the way I zipped my file using izarc. i think (but could not verify) that the mimetype file was not compressed.
Thanks for your help. |
![]() |
![]() |
![]() |
#11 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
Quote:
Dale |
|
![]() |
![]() |
![]() |
#12 |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: Oct 2008
Device: Kindle, SONY, MOBI, PALM, ePUB
|
First zip the mimetype file and add other files and folder in the same zip. So mimetype will be first file and ePubChecker will not give mimetype error.
|
![]() |
![]() |
![]() |
#13 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Actually, I made a small tool to create the ePub for me. Just the command, name of the ePub en the directory in which the files reside and presto.
I really hated the way Winzip for creation of the files. Actually, the tool also runs epubcheck beforehand. |
![]() |
![]() |
![]() |
#14 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Nov 2009
Device: None
|
Just registered because I'm having also the great mime-type error during validation.
I've created an C# application which creates a large Car Specifications ebook on the fly from a database source. For people who don't know C#. It's a windows application. The whole creation of the ebook is ended by zipping the file doing the following: Add mime-type file into a new zip file. (compression none) close that file.. Open the same file and add the OPS and META-INF with the right files (compression Best) The mimi-type file I'm using I took from another online epub book that's validated. Well...this keeps on happening: ERROR: 123456.epub: mimetype contains wrong type (application/epub+zip expected) I'm lost...nothing seems to work. Any body got a clue ? |
![]() |
![]() |
![]() |
#15 |
The Grand Mouse 高貴的老鼠
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 73,615
Karma: 315126578
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
|
Post a sample ePub.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
attribute "scheme" from namespace error in epubcheck 1.0.5 | thunderune | ePub | 15 | 06-30-2011 10:57 AM |
epub date error fails epubcheck 1.05 | dkata | Calibre | 2 | 09-13-2010 04:21 AM |
epub et mimetype | merlinetmoi | E-Books | 4 | 09-10-2010 01:20 AM |
Web-based epubcheck upgraded to epubcheck 1.0.5 | kjk | ePub | 4 | 02-09-2010 09:53 PM |
"E-books" Menu: missing entry for epub book uploads ?!? | cklammer | Feedback | 0 | 12-06-2009 06:28 AM |