Welcome to the Xceed Community Sign in | Join | Help
Community Search  

Help needed on adding Datasets to a zip file in memory

Sort Posts: Previous Next
  •  05-12-2008, 6:08 PM Post no. 12187

    Help needed on adding Datasets to a zip file in memory

    I have a webservice project currently that uses Dart's PowerTCP zip stuff and want to convert it over to Xceed Zip.  I'm having a lot of trouble figuring out if your software has a solution for this. 

     Here is what the webservice does currently:

    1.  Retrieves multiple datasets from a database

    2. Adds them seperately to 1 zip archive by converting them to a memorystream using dataset.writexml(MemoryStream,XmlWriteMode.WriteSchema).  Each dataset is named for reference in the zip file eg: onhand.data, item.data,category.data etc  Each dataset is also encrypted using AES 128 bit encryption with a password retrieved from the database.

    3. Dart's Archive allows me to then zip all these streams into another memory stream which I then return as a byte array using MemoryStream.ToArray

     I've seen some examples here on compressing a memorystream/dataset, but nothing on compressing multiple memorystream into one archive and naming each seperately.  Is this possible with Xceed?  My biggest hurdle seems to be that there's no seperation in your product on the ZipFile and the items zipped in them.  Are there seperate classes for the archive and archiveitems?  Any help pointing me in the right direction would be greatly appreciated.  Also, I use VB to program, not that I don't understand C# code, but examples in VB would be quicker for me to understand.  Thanks in advance.

     

  •  05-13-2008, 3:37 PM Post no. 12221 in reply to 12187

    Re: Help needed on adding Datasets to a zip file in memory

    Nevermind...I figured it out.  What a convoluted mess though!  Why is that everything that has to be done with your solution still requires the developer to read and write from streams/files/folders in do loops using buffers?  Couldn't you have handled all that in your side of the code?  FYI: your competitor does.  Dart just hasn't ported their code to .NET 2.0 framework yet.

     

  •  05-26-2008, 3:08 PM Post no. 12504 in reply to 12221

    Re: Help needed on adding Datasets to a zip file in memory

    Not sure I totally understand what you want to do, but first, reading and writing to stream requires to use bytes.  Second, once you have your bytes into a stream, you can transform this stream to a file, either in memory (e.g. MemoryFile) or on disk (e.g. DiskFile).  Well, actually, it is best to wrap your stream around a MemoryFile, and then write the bytes to the stream, which will automatically write the bytes to the MemoryFile.

    Moreover, we provide the ZipArchive class for the archive itself, and also ZippedFile and ZippedFolder for items within the archive.  For example, you can use a MemoryFile to zip a dataset within a ZipArchive, and retrieve it with a ZippedFile.

    As for point 3, we have a code snippet in our documentation that seems to do exactly that :

    http://doc.xceedsoft.com/products/XceedFileSystem/Creating_a_zip_file_in_memory.html

     


    André
    Software Developer and Tech Support
    Xceed Software Inc.
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.