Quote:
Originally Posted by DMSmillie
First, add the "mimetype" file to the zip file.
Then add the rest of the contents of the folder, including the sub-folders, to the zip file.
|
That is not precise enough according to the standard. Although some of the reading platforms
might read non-standard epub files.
The rules for the "mimetype" file are defined in
Open Container Format, and the text of interest (bold text used for emphasis, my intervention):
Quote:
The first file in the ZIP Container MUST be a file by the ASCII name of ‘mimetype’ which holds the MIME type for the ZIP Container (i.e., “application/epub+zip” as an ASCII string; no padding, white-space or case change). The file MUST be neither compressed nor encrypted and there MUST NOT be an extra field in its ZIP header.
|
So, using
command line zip utility, the proper command to add "mimetype" to the archive, while positioned to the directory/folder containing the file is:
zip -X0 <some other directory>\<name_of_the_target_file>.epub mimetype
Note that archive is created in some other directory, which simplifies the next step, adding the rest of the files to the same archive:
zip -Xur9D <some other directory>\<name_of_the_target_file>.epub *