ePub Submission Got You Down?

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 Linkhttp://itunes.apple.com/us/app/riley-magical-laundry-basket/id456764124?mt=8

The cover/title of Riley and the Magical Laundry Basket

Riley and the Magical Laundry Basket

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.

Screenshot of ePub directory structure.

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!

  1. #1 by Nathan on October 18th, 2011

    Hi Chris,
    Thank you so much for your article on the ePub errors you faced which I have also. My question is how do I change the directory to the root of my ePub in Terminal?

    Thank you so much for your help

  2. #2 by Chris Danielson on October 21st, 2011

    Thank you for the comment. Simply use the “cd” command in the terminal to change directories. Typically on a Mac you’ll be working in your user space. The easiest way to navigate to this location is simply:

    cd ~/Desktop/myWorkingEpubFolder
    cd ~/Documents/projects/myWorkingEpubFolder

  3. #3 by Abby on November 11th, 2011

    Thanks for your entry!

    I was wondering I am in the same boat as you but not quite. I have my .epub that I have tested on my iPad and I love it, but I am not sure how to bring it into iTunes Producer. Do you have any tips? I’ve tried Creating a New Package and New From File but all my files are greyed out. Is there something I should be doing first?

  4. #4 by Chris Danielson on November 11th, 2011

    Thanks. Did you rename the file to a .epub? The greyed out check means it is not identifying that file as a “.epub” file. -Chris

  5. #5 by Elsabe Gelderblom on June 12th, 2012

    Thanks Chris. I used your filename length fix. Worked first time. Thanks for sharing.

(will not be published)

  1. No trackbacks yet.