Home Forums .NET libraries Xceed Zip & Real-Time Zip for .NET Error zipping: Xceed.Zip.InvalidZipStructureException: The zip end header signature could not be found in the zip file

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #20130 |

    Hi there,

     

    I get a errors when zipping files on OS X 10.4.11 (Tiger) but it works great on OS X 10.5.6 (Leopard) running on mono 2.2.

    I just place the DLL’s in the same folder as the .exe and it works great on Leopard but not on Tiger.

    I am using the Xceed Zip for .Net 3.7 component and VS Studio 2005.NET and C# 2.0.

    Needless to say this code works on Windows and the latest Mac OS X.

     

    Any ideas? Thanks.

     

     

    If I use QuickZip it does create the zip file but mono and my application disappears and I get the error:

    *****************************************************************************

    My code (I also tried “/var/tmp/” folder with the same error):

      Xceed.Zip.QuickZip.Zip(“/test.zip”, true, false, false, “/test.txt”);

     

    Error returned:

    Xceed.Zip.QuickZipException: An error occurred while adding files to the zip file. —> Xceed.Zip.InvalidZipStructureException: The zip end header signature could not be found in the zip file.

    Type: Xceed.Zip.ZipArchive

    FullName: /

    Zip file: /test.txt.zip

      at Xceed.Zip.ZipHandler.ReadEndHeader (System.IO.BinaryReader reader, Xceed.Zip.ZipStream stream) [0x00000]

      at Xceed.Zip.ZipHandler.Refresh (Xceed.FileSystem.FileSystemEventsSession session) [0x00000]

      at Xceed.Zip.ZipHandler.Flush (Xceed.FileSystem.FileSystemEventsSession session) [0x00000]

      at Xceed.Zip.ZipHandler.Release (Xceed.FileSystem.FileSystemEventsSession session) [0x00000]

      at Xceed.Zip.ZipHandler.ReleaseModify (Xceed.FileSystem.FileSystemEventsSession session) [0x00000]

      at Xceed.Zip.ZipArchive.EndUpdate (Xceed.FileSystem.FileSystemEvents events, System.Object userData) [0x00000]

      — End of inner exception stack trace —

    at Xceed.Zip.QuickZip.Zip (System.String zipFileName, System.String encryptionPassword, EncryptionMethod encryptionMethod, CompressionMethod compressionMethod, Boolean replaceExistingFiles, Boolean recursive, Boolean preservePaths, Int64 splitSize, SplitNameFormat splitNameFormat, Xceed.Zip.Sfx.XceedSfxPrefix sfx, Xceed.Zip.DiskRequiredCallback diskRequiredCallback, Xceed.Zip.ByteProgressionCallback byteProgressionCallback, Xceed.Zip.ItemProgressionCallback itemProgressionCallback, System.Object userParams, System.String[] filesToZip) [0x00000]

      at Xceed.Zip.QuickZip.Zip (System.String zipFileName, System.String encryptionPassword, EncryptionMethod encryptionMethod, Boolean replaceExistingFiles, Boolean recursive, Boolean preservePaths, Int64 splitSize, SplitNameFormat splitNameFormat, System.String[] filesToZip) [0x00000]

      at Xceed.Zip.QuickZip.Zip (System.String zipFileName, System.String encryptionPassword, EncryptionMethod encryptionMethod, Boolean replaceExistingFiles, Boolean recursive, Boolean preservePaths, System.String[] filesToZip) [0x00000]

     

     

     

    If I don’t use QuickZip it does create the zip file but mono and my application disappears and I get the error:

    *****************************************************************************

    My code (I also tried “/var/tmp/” folder with the same error):

      DiskFile diskFile = new DiskFile(“/test.txt”); 

      diskFile.CopyTo(new ZipArchive(new DiskFile(“/test.zip”)), true);

     

    Error returned:

    Xceed.Zip.InvalidZipStructureException: The zip end header signature could not be found in the zip file.

    Type: Xceed.Zip.ZipArchive

    FullName: /

    Zip file: /test.txt.zip

      at Xceed.Zip.ZipHandler.ReadEndHeader (System.IO.BinaryReader reader, Xceed.Zip.ZipStream stream) [0x00000]

      at Xceed.Zip.ZipHandler.Refresh (Xceed.FileSystem.FileSystemEventsSession session) [0x00000]

      at Xceed.Zip.ZipHandler.Flush (Xceed.FileSystem.FileSystemEventsSession session) [0x00000]

      at Xceed.Zip.ZipHandler.Release (Xceed.FileSystem.FileSystemEventsSession session) [0x00000]

      at Xceed.Zip.ZipHandler.ReleaseModify (Xceed.FileSystem.FileSystemEventsSession session) [0x00000]

      at Xceed.Zip.ZipArchive.EndUpdate (Xceed.FileSystem.FileSystemEvents events, System.Object userData) [0x00000]

     

     

     

    If I don’t use QuickZip for the 3rd time with 4 lines of code, it does not create the zip file and mono and my application disappears and I get the error:

    *****************************************************************************

    My code (I also tried “/var/tmp/” folder with the same error):

      AbstractFile zipFile = new DiskFile(“/test.zip”);

      ZipArchive archive = new ZipArchive(zipFile);

      AbstractFile textFile = new DiskFile(“/test.txt”);

      textFile.CopyTo(archive, true);

     

    Error returned:

    Xceed.FileSystem.ItemDoesNotExistException: Cannot perform the requested operation on an item that does not exist.

    Type: Xceed.FileSystem.DiskFile

    FullName: /C:\TestTextFile.txt

      at Xceed.FileSystem.AbstractFile.DoCopyTo (Xceed.FileSystem.FileSystemEventsSession session, Xceed.FileSystem.FileSystemItem destination, Boolean replaceExistingFiles) [0x00000]

      at Xceed.FileSystem.FileSystemItem.ListCopyToCore (Xceed.FileSystem.FileSystemEventsSession session, Xceed.FileSystem.ItemPair currentItemPair, Boolean replaceExistingFiles) [0x00000]

    Imported from legacy forums. Posted by dv (had 5866 views)

    User (Old forums)
    Member
    Post count: 23064

    The InvalidZipStructureException is usually raised because the zip file creation/update was not completed successfully and all the required headers/footers in the Zip file format were not correctly written to disk.

    In your test, assert that the host file for your ZipArchive is not already created before starting compression. By this, I mean:

    AbstractFile zipFile = new DiskFile(“/test.zip”);

    // Assert the file does not already exist (for your test purpose)
    if(zipFile.Exists)
      zipFile.Delete();

    ZipArchive archive = new ZipArchive(zipFile);

    It may be the reason why you get this error.

    As for the last error (ItemDoesNotExistException with “/C:\TestTextFile.txt”), is it possible that you are accessing/updating a zip file previously created on Windows?

    Imported from legacy forums. Posted by André (had 2288 views)

    User (Old forums)
    Member
    Post count: 23064

    Hello.  I’m getting the same error, using the following code:

    // Create the virtual ZIP file

    MemoryStream ms =

    new MemoryStream();

    Xceed.FileSystem.StreamFile streamFile =

    new Xceed.FileSystem.StreamFile( ms );

    Xceed.Zip.ZipArchive za =

    new Xceed.Zip.ZipArchive( streamFile );

     

    I should point out that I’m trying to build a .Net 1.1 app, using version 2.3.5357 Xceed components.  I’ve even created a new c# 1.1 app with just this code (besides of course setting the license key), and I still get the error.  Why doesn’t this work?  Thanks!

    Imported from legacy forums. Posted by Joshua (had 1819 views)

    User (Old forums)
    Member
    Post count: 23064

    We do not get this exception using version 3.2, which is still .NET 1.1.  I suggest you update to this version to see if you still get the exception.

    Here is the link to the latest .NET 1.1 service release :

    http://xceed.com/Xredirect.aspx?url=http://download4.xceedsoft.com/Packages/ServicePacksNET11/Xceed.Components.SP.NET1.1.8115.exe

    Imported from legacy forums. Posted by André (had 3597 views)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.