I want to create an archive with a number of subfolders and add files to these folders.
I have found out how to do it with a physical file, which is quite easy, but I want to find out how to add a document from memory to a subfolder.
I have this example code:
DataTable dt = GetDataFromDataSource();
using (StringWriter sw = new StringWriter())
testdata = sw.ToString();
Response.ContentType = "application/zip";
using (zip = new ZipFile())
Here, the "testdata" XML document is added to the root of the archive as a file named Export.xml.
So, the question is, could someone please tell me, how to add the "testdata" XML document to the Data folder as a file named Export.xml?
I'll be using this in an ASP.NET solution, where I have the data in memory, and I'll prefere to avoid the extra step of writing the data to physical files, as well as the cleanup afterwords.