The key issue with the mimetype file is that it must be the first file and it must be added as stored, not compressed. The easiest way to do this is with the command line (info)zip program. Create the file first by adding the mimetype file with compression 0 (store). Then append all the other files to this zip file with the compression factor of your choice. But the mimetype, must be the first file and it must be stored. I don't know if using WinRAR or other programs will maintain the position of the mimetype as the first. The infozip program does.
I've been planning on writing a program to specifically zip up a directory tree into an epub file. I'll get to it real soon now. I just need to find a cross-pltform zip library for Free Pascal. As I said, real soon now.
|