Archive for category ePub
Today I released my new interactive digital children’s book, Riley and the Magical Laundry Basket iPhone/iPad application. I wanted to take the story to the next level by releasing an ePub version into Apple’s iBookstore. The story is about Riley as she is transported away to an imaginary world via her magical laundry basket. In this world she is trying to get to the cupcake palace. iTunes Link: http://itunes.apple.com/us/app/riley-magical-laundry-basket/id456764124?mt=8
I wanted to release Riley and the Magical Laundry Basket as an ePub book. I was absolutely ecstatic as my final “.epub” file worked flawlessly and looked beautifully in my initial tests on iPad and iPhone. Today, I decided I was going to move ahead and upload the file using iTunes Producer. I became frantic as I discovered a host of errors produced by iTunes Producer and when I searched online, I didn’t find much help! I’m going to take the esoteric “errors” you see and translate them for any/all people. If you need help just add in a comment, but these were my basic errors and how I solved them today.
My first error encountered. This error made me go cross eyed trying to figure out what exactly the trouble was.
“length of first filename in archive must be 8, but was 9”
Chris’ Translation & Solution: make sure that the “mimetype” file is the first one compressed into your epub archive file. Don’t worry I’ll show you how to fix it near the end of this post.
My second error:
“extra field length for first filename must be 0, but was 28” at Book (MZItmspBookPackage)
Chris’ Translation & Solution: the zip command or tool you are using is adding additional file attributes into the archive or compressed file.
Using the command line (terminal) on my Macbook I was able to fix both these issues. I changed directory to the root of my epub book and ran the following command.
zip -X -r rmlb.epub mimetype *
The -X listed removes the extra file attributes (from issue #2) shown. Explicitly defining that the mimetype file is the first file to compress fixes issue #1. A little further explanation of the command shown… The -r means “recursively”, basically add everything within the current directory including other sub-directories. The rmlb.epub is the final name of the .epub file. The * is a wildcard character telling the zip command to put everything into the archive.
My directory structure looked as follows.
I saw many references to using the OEBPS folder, but in this case it is not necessary. You just have to make sure that you add the “mimetype” file first into the archive.
After I did the following command, iTunes Producer accepted my ePub book and now I’m waiting for Apple’s approval.
Happy coding and I hope this helps you if you had an issue!