Creating Zip file from stream and downloading it

2 things. First, if you keep the code design you have, you need to perform a Seek() on the MemoryStream before writing it into the entry. dt.TableName = “Declaration”; MemoryStream stream = new MemoryStream(); dt.WriteXml(stream); stream.Seek(0,SeekOrigin.Begin); // <– must do this after writing the stream! using (ZipFile zipFile = new ZipFile()) { zipFile.AddEntry(“Report.xml”, “”, stream); … Read more