Home Forums .NET libraries Xceed Zip & Real-Time Zip for .NET Get files from a Zip within a Zip works in 2.0 but not 4.2

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

    I used to be able to get files from a zip within a zip (see following example)

     

    ParentZipFile.zip
      ChildFile1.txt
      ChildFile2.txt
      ChildZipFile.zip
        GrandChildFile1.txt
        GrandChildFile2.txt

     But now get an exception when the following code is run

        Dim ParentZipDiskFile As New Xceed.FileSystem.DiskFile(“ParentZipFile.zip”)
        Dim ParentZipArchive As New Xceed.Zip.ZipArchive(ParentZipDiskFile)

        Dim ChildZippedFile As Xceed.Zip.ZippedFile = ParentZipArchive.GetFile(“ChildZipFile.zip”)
        ‘ This works in 2.0 and FAILS 4.2
        Dim ChildZipArchive As New Xceed.Zip.ZipArchive(ChildZippedFile)

            System.ArgumentException was unhandled
            Message = “The inner stream must be seekable.”
            Source = “Xceed.Zip”
        StackTrace:
               at Xceed.Zip.ZipStream..ctor(FileSystemEventsSession session, ZipStorage storage, Stream stream, Boolean forWriting)
               at Xceed.Zip.ZipRefreshStream..ctor(FileSystemEventsSession session, ZipStorage storage, Stream stream, Boolean forWriting)
               at Xceed.Zip.ZipHandler.OnPreparingRefreshStream(FileSystemEventsSession session, FileShare share, Stream stream)
               at Xceed.Utils.Storage.StorageHandler.Refresh(FileSystemEventsSession session, Boolean forceRefresh)
               at Xceed.Zip.ZipHandler.GetZipHandler(FileSystemEventsSession session, AbstractFile zipFile)
               at Xceed.Zip.ZippedFolder..ctor(FileSystemEvents events, Object userData, AbstractFile zipFile, String folderName)
               at Xceed.Zip.ZipArchive..ctor(FileSystemEvents events, Object userData, AbstractFile zipFile)
               at Xceed.Zip.ZipArchive..ctor(AbstractFile zipFile)

    Any ideas on a (non-clunky) workaround? or perhaps this is a bug in 4.2 ?

    thanks!

    Imported from legacy forums. Posted by aaron (had 1760 views)

    User (Old forums)
    Member
    Post count: 23064

    I found a reasonable workaround – just copy the Child zip into a memory file:

              Dim ChildZipInMemory As New MemoryFile(“RAM:” & ChildZippedFile.FullName)
              ChildZippedFile.CopyTo(ChildZipInMemory .ParentFolder, True)

     Can now use ChildZipInMemory zip file without problem as it has been detached from its Parent zip file.

             Dim ChildZipArchive As New Xceed.Zip.ZipArchive(ChildZipInMemory)

    Imported from legacy forums. Posted by aaron (had 639 views)

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi Aaron,

    This is to inform you that this issue is now fixed in the latest version:
    http://xceed.com/updates

     

    Imported from legacy forums. Posted by Diane [Xceed] (had 1082 views)

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