Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 10-10-2009, 03:31 AM   #1
rjnagle
Zealot
rjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it is
 
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:
mimetype entry missing or not the first in archive

A valid epub file must contain an uncompressed file named mimetype as a first entry in the zip archive. That file must contain epub mime type (application/epub+zip).
That's the only error message I get. Everything else validates through epubcheck. Frankly, this is driving me crazy!


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.)
the mimetype file has no file extension and only one line:

"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
rjnagle is offline   Reply With Quote
Old 10-10-2009, 05:39 AM   #2
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,515
Karma: 18512745
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
Then add the rest of the files with maximum compression:

Code:
zip -9 -r file.epub META-INF OEBPS
You can probably do the same with Winzip or similar.
Jellby is offline   Reply With Quote
Advert
Old 10-10-2009, 10:18 AM   #3
rjnagle
Zealot
rjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it is
 
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.
rjnagle is offline   Reply With Quote
Old 10-10-2009, 01:12 PM   #4
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,515
Karma: 18512745
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.
Jellby is offline   Reply With Quote
Old 10-10-2009, 01:22 PM   #5
rjnagle
Zealot
rjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it is
 
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:
mimetype contains wrong type (application/epub+zip expected)
Things open up in calibre and Adobe DE ok. Could this be a problem with epubcheck?

Quote:
Robert Admin@kunderavista /cygdrive/i/My Documents/xml/rj3
$ zip -0 cyg2.epub mimetype
adding: mimetype (stored 0%)

Robert Admin@kunderavista /cygdrive/i/My Documents/xml/rj3
$ zip -9 -r cyg2.epub META-INF OEBPS
adding: META-INF/ (stored 0%)
adding: META-INF/container.xml (deflated 30%)
adding: OEBPS/ (stored 0%)
adding: OEBPS/bk01-toc.html (deflated 65%)
adding: OEBPS/content.opf (deflated 75%)
adding: OEBPS/cover.html (deflated 34%)
adding: OEBPS/er001.html (deflated 59%)
adding: OEBPS/er007.html (deflated 45%)
adding: OEBPS/er009.html (deflated 41%)
adding: OEBPS/es001.html (deflated 53%)
adding: OEBPS/first.css (deflated 6%)
adding: OEBPS/first.zip (deflated 64%)
adding: OEBPS/images/ (stored 0%)
adding: OEBPS/images/cover.jpg (deflated 0%)
adding: OEBPS/in001.html (deflated 53%)
adding: OEBPS/index.html (deflated 46%)
adding: OEBPS/mimetype (stored 0%)
adding: OEBPS/pr001.html (deflated 59%)
adding: OEBPS/pt01.html (deflated 41%)
adding: OEBPS/pt02.html (deflated 43%)
adding: OEBPS/pt03.html (deflated 43%)
adding: OEBPS/pt04.html (deflated 42%)
adding: OEBPS/pt05.html (deflated 41%)
adding: OEBPS/toc.ncx (deflated 82%)
adding: OEBPS/un001.html (deflated 43%)

Robert Admin@kunderavista /cygdrive/i/My Documents/xml/rj3
I'm reluctant to make this .epub public for inspection (it's for a client). But I might be able to create another project to replicate this problem.

I gotta say, this seems really weird.

Last edited by rjnagle; 10-10-2009 at 01:30 PM.
rjnagle is offline   Reply With Quote
Advert
Old 10-10-2009, 01:39 PM   #6
rjnagle
Zealot
rjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it is
 
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.
rjnagle is offline   Reply With Quote
Old 10-10-2009, 02:25 PM   #7
Peter Sorotokin
speaking for myself
Peter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it is
 
Posts: 139
Karma: 2166
Join Date: Feb 2008
Location: San Francisco Bay Area
Device: PRS-505
Quote:
Originally Posted by rjnagle View Post
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:

mimetype contains wrong type (application/epub+zip expected)
make sure you mimetype file has no trailing spaces or end-of line characters in it.

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.
Peter Sorotokin is offline   Reply With Quote
Old 10-10-2009, 02:38 PM   #8
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,515
Karma: 18512745
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
I left out the -X an -D flags because they were not meaningful for what I was trying to say, and I figured they're not actually needed (they say the zip program not to store additional file attributes and directory entries), maybe the -X flag is needed (I still don't think so)?

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.
Jellby is offline   Reply With Quote
Old 10-11-2009, 03:53 AM   #9
Sweetpea
Grand Sorcerer
Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.
 
Sweetpea's Avatar
 
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)
Sweetpea is offline   Reply With Quote
Old 10-11-2009, 06:00 PM   #10
rjnagle
Zealot
rjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it isrjnagle knows what time it is
 
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.
rjnagle is offline   Reply With Quote
Old 10-13-2009, 11:46 AM   #11
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
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:
Originally Posted by rjnagle View Post
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.
To verify that the mimetype is not compressed just look at the zipped file. Use more in a command line window or notepad or some other application. The whole idea is that the mimetype should show up in these kinds of applications so it can be tested without opening the file with zip.

Dale
DaleDe is offline   Reply With Quote
Old 11-17-2009, 06:17 AM   #12
subhash4d1
Junior Member
subhash4d1 began at the beginning.
 
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.
subhash4d1 is offline   Reply With Quote
Old 11-18-2009, 05:38 AM   #13
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
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.
Toxaris is offline   Reply With Quote
Old 11-23-2009, 07:14 AM   #14
GijsZePa
Junior Member
GijsZePa began at the beginning.
 
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 ?
GijsZePa is offline   Reply With Quote
Old 11-23-2009, 07:43 AM   #15
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 71,496
Karma: 306214458
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
Post a sample ePub.

Quote:
Originally Posted by GijsZePa View Post
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 ?
pdurrant is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 07:00 PM.


MobileRead.com is a privately owned, operated and funded community.