dcsimg
Add file to a Zip file.
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Rajneet_Singh
Posted On:   Tuesday, June 8, 2004 03:42 AM

Dear Sir/Madam,

I am able to add a file in a zip file. Only the problem

is that the new file which I add, replaces the files

which are already present.

e.g Say my zip file is test.zip, having three text

files, first.txt,second.txt,third.txt. When i add a

new txt file, say try.txt(putNextEntry("try.txt")),

it removes the existing files

first.txt,second.txt,third.txt.



Please let me know how can i solve this problem.


Thanks,

R S

Re: Add file to a Zip file.

Posted By:   Christopher_Koenigsberg  
Posted On:   Tuesday, June 8, 2004 10:45 AM

The command-line "zip" program takes the "-u" arg, to do "update only" which will only add new files, or replace changed files, in an existing zip archive.

Re: Add file to a Zip file.

Posted By:   narender_reddy  
Posted On:   Tuesday, June 8, 2004 04:24 AM

there is no such provision directly as such.But definitely there are so many ways,for eg,

like you can unzip the files into a folder which should be
created dynamically. copy new file to that and rezip
it.the folder has to be deleted after.
-or else
get the entries simataneousely from one zip and put that into new zip file,finally you add new file .delete old one .... likewise..many
About | Sitemap | Contact