Adding to existing Zip File....


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Adding to existing Zip File....

  1. #1
    Bill Carpenter Guest

    Adding to existing Zip File....


    I need to be able to open an existing Zip file and add new files to it without
    overwriting what is already there. I keep overwriting the file, I am passing
    a file output stream to the Zipoutput stream and I set it for append. I
    tried playing with the offset but was unsuccessful, any help would be greatly
    appreciated!

    Thanks!

    Bill Carpenter

  2. #2
    Paul Clapham Guest

    Re: Adding to existing Zip File....

    I don't know if you've ever observed how commercial products like WinZip do
    this. Try using one to append a new file to an existing zip archive.
    You'll notice (through the status line) that it creates an entirely new
    archive that contains the old contents plus the additions. I believe this
    is what you will have to do too.

    (A zip archive always has its directory at the end. So appending something
    after that breaks the file format.)

    PC2

    Bill Carpenter <dragon@darkmage.com> wrote in message
    news:3a7274e8$1@news.devx.com...
    >
    > I need to be able to open an existing Zip file and add new files to it

    without
    > overwriting what is already there. I keep overwriting the file, I am

    passing
    > a file output stream to the Zipoutput stream and I set it for append. I
    > tried playing with the offset but was unsuccessful, any help would be

    greatly
    > appreciated!
    >
    > Thanks!
    >
    > Bill Carpenter




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center