Reputation: 2379
Is it possible to create a file within a Zip file?
Let's say I have a file abc.zip
and want to create a file in it named SomeFile.txt
. Is it possible? [I am using a dll Ionic.Zip which helps with Zip file manipulation]. Also, I want to do this without unzipping it.
Upvotes: 0
Views: 233
Reputation: 437834
Sure. For example, if you have already created SomeFile.txt
:
using (var zip = ZipFile.Read("abc.zip"))
{
zip.AddFile("SomeFile.txt");
zip.Save();
}
Upvotes: 5