SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Open Office no longer opens ODT file created by SharpZipLib

Last post 07-07-2009 10:06 PM by joan. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 05-28-2009 12:18 AM

    Open Office no longer opens ODT file created by SharpZipLib

    We use SharpZipLib to create Open Office Writer (ODT) files, which are a zipped collection of XML documents, including a JAR-type manifest. This worked very successfully with SharpZipLib 0.5.

    However, when we 'upgraded' to the latest version (0.85), we started getting messages indicating that Open Office Writer thinks our ODT files are corrupt and cannot open or repair them.

    We are able to change the file extension to .zip, open the file with another tool, extract the XML files, compress them into a new archive, and change the new archive's extension to .odt, and it then opens just fine. So it seems there is something odd about the zip file SharpZipLib is creating which affects Open Office, but not most other Zip file readers.

    Any suggestions would be most welcome.

  • 06-02-2009 4:28 PM In reply to

    • pbb
    • Not Ranked
    • Joined on 03-15-2007
    • Posts 4

    Re: Open Office no longer opens ODT file created by SharpZipLib

    I am having the same problem!

    And I found another application that is having problems with the ZIP files created: Beyond Compare will report "Cannot extract file - newer version required" when trying to open a SharpZipLib created ZIP file.

  • 06-02-2009 4:55 PM In reply to

    • pbb
    • Not Ranked
    • Joined on 03-15-2007
    • Posts 4

    Re: Open Office no longer opens ODT file created by SharpZipLib

    Update: Everything works fine when I'm using the .84 release! No changes at all to my source code, just replaced the DLL and valid ODT files are created. Use any of the .85 releases, and the files are reported as corrupted...

  • 06-02-2009 5:53 PM In reply to

    Re: Open Office no longer opens ODT file created by SharpZipLib

    I found a work-around: if we assemble all the files into a folder and use FastZip to zip them, we get a useable OO document.

  • 06-10-2009 2:01 AM In reply to

    Re: Open Office no longer opens ODT file created by SharpZipLib

    As an alternative, try setting

    zs.UseZip64 = UseZip64.Off;
    before the zs.PutNextEntry()

    SharpZip now defaults to Zip64 format if it is unsure how large the file will be.

  • 06-26-2009 9:46 AM In reply to

    • pbb
    • Not Ranked
    • Joined on 03-15-2007
    • Posts 4

    Re: Open Office no longer opens ODT file created by SharpZipLib

    Thanks, that did the trick !!

  • 07-07-2009 10:06 PM In reply to

    • joan
    • Not Ranked
    • Joined on 06-22-2009
    • Posts 2

    Re: Open Office no longer opens ODT file created by SharpZipLib

    I was having the same issue but with a different cause, I'll write it down here in case it can help someone else.

    For the context, I am manually outputting the file content from streams so I explicitely creates the zip entries by hand (not from a temporary folder).

     

    My problem was that I added the manifest.xml by creating an entry for "META-INF\\manifest.xml".

    The resulting file wasn't readable by OpenOffice, but unzipping and rezipping it with 7Z made it work magically...

    Using the FastZip class on a temporary folder also made it work.

     

    Cause: the directory separators must be forward slashes : "META-INF/manifest.xml".

Page 1 of 1 (7 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.