View Full Version : Field length for first filename too long


djstormer
09-29-2012, 03:24 PM
I am working through the creation of my first epub file and am at the stage of testing it using http://validator.idpf.org/

One error I keep getting is this:
Extra field length for first filename must be 0, but was [BIG NUMBER]!

From what I've read, this is because one of the two folders in the .zip archive is getting read before the mimetype file. So... I'm trying to use 7-Zip via the command line, because using 7-Zip that way (probably command 'x') looks likely to be able to preserve the order in which the files & folders were added to the zip archive, i.e. keep mimetype at the top.

However - a whole new problem - I can't get the command prompt to do anything, even after having configured it to open directly in the folder of my choice.

I'm feeling stuck here. There must be a way of getting the mimetype file to get read first - and I would really appreciate it if anyone who's had the same problem could let me know.

Doitsu
09-29-2012, 04:28 PM
7Zip is a great tool, but in my experience, you cannot use it to modify files in an .epub.
Try ePubPack (http://sourceforge.net/projects/epubpack/) instead or simply open and save your book with Sigil (http://code.google.com/p/sigil/downloads/list). (Since Sigil will change your folder structure, don't use it, if you must maintain your current folder structure.)

DiapDealer
09-29-2012, 06:43 PM
Keep in mind that the mimetype file must be uncompressed in the zip archive as well as first. In my experience, there's very few "standard" archiving programs that give you enough control to guarantee everything gets put in the archive correctly (without jumping through a variety of hoops). It's best to use something specifically designed for ePubs. I've never used the one Doitsu mentioned, but it looks like it would do the trick. There's also an applescript floating around here somewhere that will do the job for OS X users.

Freeshadow
09-29-2012, 09:45 PM
As it was pointed out before, recompression of epubs is best done with tools which assure correct treatment of the mimetype file.
If you want to profit from 7zips higher zip compression use http://en.wikipedia.org/wiki/AdvanceCOMP on the finished epub. As it only works with compressed dataparts of the zip only it won't mess the uncompressed mimetype file.