OEBPS Container (ocf) Zip

Jun 4, 2009 at 6:06 AM

I need to create an ocf zip container. Has anybody done that before ? The extract from the specification below shows the requirements:

- ZIP Containers MUST only include uncompressed files or Flate-compressed files within the ZIP arch 
- OCF ZIP Containers MUST encode File System Names using UTF-8.
- OCF ZIP Containers MUST set the ‘version needed to extract’ fields to the values 10, 20 or 45 ...
- OCF ZIP Containers MUST set the ‘compression’ method field to the values 0 or 8
- In ZIP Container MUST be a file by the ASCII name of ‘mimetype’ ... The file MUST be neither compressed nor encrypted and there MUST NOT be an extra field in its ZIP header

there is an additional requirement to exclude "extra file attributes" like it is done with the -X Option of InfoZip. Don't know if that is relevant on windowssystems.

I do not know anaything about zip. Is there anything special in that requirements and is possible to do that with DotNetZipLib?

thanks in advance

kind regards



Jun 4, 2009 at 7:48 AM

I don't know OCF or OEBPS.

But, it seems like it would just work.

I also don't know what the InfoZip -X option is supposed to do. 

Have you tried it?

Jun 4, 2009 at 9:51 AM

Hello Cheeso,

thanks for your answer.

As far as I understand the -X-Option "Do not save Extended Attributes or uid/gid and file times" it is for unix-systems, but I'm not sure.  That is something I have to find out.

kind regards


Jun 7, 2009 at 9:04 PM

ok, and so have you tried to create the zip file according to the requirements you have?

The requirement that "version need to extract must be 10, 20 or 45"  - will just happen.  Those are the only values that DotNEtZip will produce in a zip file.

The UTF-8 encoding of filesystem information will happen if you use UseUnicodeAsNecessary, and if the filenames actually need UTF-8.  If the filenames can be encoded in IBM437 (~ASCII), then IBM437 will be used.  Not sure if this is a problem for your consumer of OEBPS OCF zip files, but it is in compliance with the zip spec and I would guess it would be no problem for whatever system is reading the zip file.

The file of name "mimetype" is easy to do - you must set CompressionMethod to 0 on the ZipEntry.    It will not be encrypted if you don't set the Password property on the ZipEntry.

The InfoZip program can embed "Extra" fields in the zip file.  DotNetZip does not do this.

So I think you should be able to create the zip file as you need.